diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yaml | 85 |
1 files changed, 31 insertions, 54 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e004fd3..cd5c05e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,50 +7,36 @@ on: workflow_dispatch: jobs: - eval: - name: Evaluate flake - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.evaluate.outputs.matrix }} - - steps: - - uses: actions/checkout@v4 - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v9 - - - name: Evaluate matrix - id: evaluate - run: | - set -eu - echo "matrix=$(nix eval --show-trace --json .#githubWorkflow.matrix)" >> "$GITHUB_OUTPUT" - build: - needs: eval - strategy: fail-fast: false - matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} - - name: Build (${{ matrix.attr }}) + matrix: + include: + - os: ubuntu-latest + system: x86_64-linux + - os: macos-latest + system: x86_64-darwin + - os: ubuntu-latest + system: aarch64-linux + + name: Build (${{ matrix.system }}) runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Setup QEMU - if: matrix.arch == 'aarch64' + if: matrix.system == 'aarch64-linux' uses: docker/setup-qemu-action@v3 with: platforms: "arm64" - name: Install Nix - if: matrix.arch != 'aarch64' + if: matrix.system != 'aarch64' uses: DeterminateSystems/nix-installer-action@v9 - name: Install Nix (with aarch64) - if: matrix.arch == 'aarch64' + if: matrix.system == 'aarch64' uses: DeterminateSystems/nix-installer-action@v9 with: extra-conf: "extra-platforms = aarch64-linux arm-linux" @@ -63,7 +49,18 @@ jobs: - name: Run build run: | - nix build -L --accept-flake-config .#${{ matrix.attr }} + args=( + --inputs-from . + --override-input nixpkgs nixpkgs + github:Mic92/nix-fast-build -- \ + --no-nom \ + --skip-cached \ + --systems '${{ matrix.system }}' + --option accept-flake-config true \ + --flake '.#packages' + ) + + nix run "${args[@]}" check: strategy: @@ -80,32 +77,12 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@v9 - - name: Setup Cachix - uses: cachix/cachix-action@v13 - with: - name: getchoo - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - name: Run check - run: nix flake check --show-trace --accept-flake-config - - # https://github.com/orgs/community/discussions/26822#discussioncomment-3305794 - gate: - needs: [build, check] - - name: CI Gate - runs-on: ubuntu-latest - - if: always() - - steps: - - name: Exit with result run: | - build_result="${{ needs.build.result }}" - check_result="${{ needs.check.result }}" - - results=("$build_result" "$check_result") - - for result in "${results[@]}"; do [ "$result" != "success" ] && exit 1; done + args=( + --print-build-logs + --show-trace + --accept-flake-config + ) - exit 0 + nix flake check "${args[@]}" |
