ci: use nix-eval-jobs #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
eval: | |
name: Evaluate hydraJobs | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.eval.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
- name: Generate matrix | |
id: eval | |
run: | | |
echo "matrix=$(nix run .#generate-actions-matrix)" >> "$GITHUB_OUTPUT" | |
build: | |
name: Build ${{ matrix.attr }} | |
needs: [ eval ] | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.eval.outputs.matrix) }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
- name: Setup Cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: prismlauncher | |
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
- name: Build ${{ matrix.attr }} | |
run: | | |
nix build --print-build-logs '${{ matrix.drvPath }}^*' | |
# Cumulative job for all of the above | |
release-gate: | |
name: Release Gate | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Exit with error | |
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: exit 1 |