diff options
| author | seth <[email protected]> | 2023-12-25 05:00:05 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-25 05:10:04 -0500 |
| commit | 0cc0ada5d44ade6cab2e9220f7993aaf77985e1b (patch) | |
| tree | 122d23d5cd27144fd491ea43f7082bfaf9ae8f76 /.github/workflows | |
| parent | d3572003f2aee35d7cfa3457dfe4fa4309a55ff1 (diff) | |
actions: use nix2workflow again
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yaml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c4fc11e..f8e429e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,19 +31,21 @@ jobs: - name: Evaluate jobs id: eval run: | - nix shell --inputs-from . \ - nixpkgs#{bash,coreutils,jq,nix-eval-jobs} \ - --command bash ./.github/eval-flake.sh + echo "matrix=$(nix eval --show-trace --json .#workflowMatrix)" >> "$GITHUB_OUTPUT" build: needs: eval strategy: + fail-fast: false matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} name: Build (${{ matrix.attr }}) runs-on: ${{ matrix.os }} + env: + JOBS: "hydraJobs" + steps: - uses: actions/checkout@v4 @@ -56,19 +58,22 @@ jobs: name: getchoo authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - name: Check if cached - if: ${{ matrix.isCached }} - run: | - echo ${{ matrix.attr }} is already built! - - name: Run build - if: ${{ !matrix.isCached }} run: | + for url in "https://cache.nixos.org" "https://getchoo.cachix.org"; do + if nix eval --raw .#"$JOBS".${{ matrix.attr }} \ + | cut -c12-43 \ + | xargs -I {} curl -f "$url"/{}.narinfo &> /dev/null; then + echo ${{ matrix.attr }} is already cached in $url! + fi + done + nix build --print-build-logs --fallback \ - .#hydraJobs.${{ matrix.attr }} + .#"$JOBS".${{ matrix.attr }} check: strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] |
