From c8cc54b432460548b0361c567bc6fd0f75850b79 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Tue, 4 Jun 2024 19:05:47 +0100 Subject: [PATCH] Split build steps --- .github/workflows/build-and-cache.yaml | 32 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-cache.yaml b/.github/workflows/build-and-cache.yaml index 3ef34f4..699a7f2 100644 --- a/.github/workflows/build-and-cache.yaml +++ b/.github/workflows/build-and-cache.yaml @@ -7,6 +7,24 @@ concurrency: cancel-in-progress: true jobs: + nix: + runs-on: ubuntu-latest + + steps: + - name: Check out source code + uses: actions/checkout@v4 + + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.22.1/install + + - name: Check Nix formatting + run: nix fmt . -- --check + + - name: Check Nix flake + run: nix flake check --all-systems + build: strategy: matrix: @@ -24,27 +42,21 @@ jobs: uses: actions/checkout@v4 - name: Install nix - uses: cachix/install-nix-action@v25 + uses: cachix/install-nix-action@v27 with: - install_url: https://releases.nixos.org/nix/nix-2.18.0/install + install_url: https://releases.nixos.org/nix/nix-2.22.1/install - name: Use GitHub cache uses: DeterminateSystems/magic-nix-cache-action@main - - name: Check Nix formatting - run: nix fmt . -- --check - - - name: Check Nix flake - run: nix flake check --all-systems - - name: Build nix package run: nix build -L .#${{ matrix.package }} + - run: result/bin/${{ matrix.package }} --version + - name: Run nix app run: nix run .#${{ matrix.package }} -- --version - - run: result/bin/${{ matrix.package }} --version - # - name: Setup tmate session # if: failure() # uses: mxschmitt/action-tmate@v3