From c4f021bb29670b4d943f805c03040ebb21bc5787 Mon Sep 17 00:00:00 2001 From: debora berte Date: Fri, 24 Jan 2025 08:06:53 -0300 Subject: [PATCH] fix: nix ci --- .github/workflows/nix.yml | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 85cb21d..8f6d92b 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,5 +1,4 @@ name: Nix CI - on: push: branches: [ main ] @@ -7,23 +6,38 @@ on: branches: [ main ] jobs: - tests: - runs-on: ${{ matrix.os }} + configure: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + - id: set-matrix + # Set a default matrix in case ci fails + run: | + echo "matrix={\"include\":[{\"system\":\"x86_64-linux\",\"subflake\":\"default\"},{\"system\":\"aarch64-darwin\",\"subflake\":\"default\"}]}" >> $GITHUB_OUTPUT + nix run .#nixci -- gh-matrix --systems=x86_64-linux,aarch64-darwin | jq -c . >> $GITHUB_OUTPUT + + nix: + runs-on: ${{ matrix.system }} + permissions: + contents: read + needs: configure strategy: - matrix: - os: [ubuntu-latest] - system: [x86_64-linux, aarch64-darwin] + matrix: ${{ fromJson(needs.configure.outputs.matrix) }} + fail-fast: false steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v25 - with: - nix_path: nixpkgs=channel:nixos-unstable - uses: DeterminateSystems/magic-nix-cache-action@v2 - run: | - nix build \ + nix run .#nixci -- \ --extra-access-tokens "github.com=${{ secrets.GITHUB_TOKEN }}" \ - .#default.${{ matrix.system }} - + build \ + --systems "${{ matrix.system }}" \ + .#default.${{ matrix.subflake}} + - name: Upload artifact uses: actions/upload-artifact@v3 with: