From 442056f7f4c28f9a2637a4d6b262572fe9e4b30a Mon Sep 17 00:00:00 2001 From: Levi Zim Date: Sat, 2 Nov 2024 12:44:47 +0800 Subject: [PATCH] ci: split nix ci from main ci --- .github/workflows/ci.yml | 16 ---------------- .github/workflows/nix.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee8a2a3..bd7346d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,22 +75,6 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Run clippy run: cargo clippy - nix: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: | - sudo apt-get update -y - sudo apt-get install -y qemu-kvm - - uses: cachix/install-nix-action@v27 - with: - nix_path: nixpkgs=channel:nixos-unstable - - uses: DeterminateSystems/magic-nix-cache-action@v2 - # Build and test tracexec - # Also builds kernels - - run: nix build - # Run Userspace<->Kernel CI - - run: nix run '.#ukci' check_and_test: strategy: fail-fast: false diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..b97c796 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,34 @@ +name: Continuous Integration (Nix) + +on: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + push: + branches: + - main + pull_request: + merge_group: + +# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel +# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + nix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + sudo apt-get update -y + sudo apt-get install -y qemu-kvm + - uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-unstable + - uses: DeterminateSystems/magic-nix-cache-action@v2 + # Build and test tracexec + # Also builds kernels + - run: nix build + # Run Userspace<->Kernel CI + - run: nix run '.#ukci'