diff options
Diffstat (limited to '.github')
| -rwxr-xr-x | .github/eval-flake.sh | 36 | ||||
| -rw-r--r-- | .github/workflows/ci.yaml | 82 |
2 files changed, 26 insertions, 92 deletions
diff --git a/.github/eval-flake.sh b/.github/eval-flake.sh deleted file mode 100755 index 57f52c3..0000000 --- a/.github/eval-flake.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -args=( - --gc-roots-dir gc-roots - --check-cache-status - --force-recurse - --option allow-import-from-derivation true - --option accept-flake-config true - --show-trace - --flake - '.#hydraJobs' -) - -jobs=$(nix-eval-jobs "${args[@]}" | tee eval.json | jq -s '.') - -errors=$(echo "$jobs" | jq -r '.[] | select(.error)') -[ "$errors" != "" ] && exit 1 - -echo "$jobs" | jq -c ' - def to_os: - if .system == "x86_64-linux" then "ubuntu-latest" - elif .system == "x86_64-darwin" then "macos-latest" - else null - end; - - { - "include": [ - .[] | { - attr, - isCached, - "os": to_os - } - ] - } -' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c852112..b932e9d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,73 +5,39 @@ on: workflow_call: secrets: CACHIX_AUTH_TOKEN: - description: "auth token for cachix" + description: "Auth token for cachix" workflow_dispatch: jobs: - eval: - name: Evaluate flake - runs-on: ubuntu-latest - - outputs: - matrix: ${{ steps.eval.outputs.matrix }} - - steps: - - uses: actions/checkout@v4 - - - 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: Evaluate jobs - id: eval - run: | - set -euo pipefail - - matrix=$(nix shell --inputs-from . \ - nixpkgs#{bash,coreutils,jq,nix-eval-jobs} \ - --command ./.github/eval-flake.sh) - - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - build: - needs: eval - - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} - - name: Build (${{ matrix.attr }}) - runs-on: ${{ matrix.os }} + name: Build outputs + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - if: ${{ !matrix.isCached }} - name: Install Nix - if: ${{ !matrix.isCached }} uses: DeterminateSystems/nix-installer-action@v9 - name: Setup Cachix - if: ${{ !matrix.isCached }} uses: cachix/cachix-action@v13 with: name: getchoo authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Run build - if: ${{ !matrix.isCached }} run: | - nix build \ - --accept-flake-config \ - --print-build-logs \ - --fallback \ - .#hydraJobs.${{ matrix.attr }} + args=( + --inputs-from . + --override-input nixpkgs nixpkgs + github:Mic92/nix-fast-build -- + --no-nom + --skip-cached + --option accept-flake-config true + --flake '.#hydraJobs' + ) + + nix run "${args[@]}" check: strategy: @@ -95,12 +61,14 @@ jobs: - name: Run check run: | - nix flake check \ - --accept-flake-config \ - --print-build-logs \ - --fallback \ - --show-trace \ + args=( + --print-build-logs + --show-trace + --accept-flake-config --allow-import-from-derivation + ) + + nix flake check "${args[@]}" gate: needs: [build, check] @@ -113,8 +81,10 @@ jobs: steps: - name: Exit with result run: | - build_result="${{ needs.build.result }}" - check_result="${{ needs.check.result }}" - results=("$build_result" "$check_result") + results=( + "${{ needs.build.result }}" + "${{ needs.check.result }}" + ) + for result in "${results[@]}"; do [ "$result" != "success" ] && exit 1; done exit 0 |
