gha: attempt to minimize CI time #48
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: "Build closures with Colmena" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
generate_matrix: | ||
runs-on: ubuntu-latest | ||
name: "Generate hive list" | ||
outputs: | ||
matrix: ${{ steps.matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/bootstrap.yml | ||
secrets: inherit | ||
Check failure on line 14 in .github/workflows/closures.yml GitHub Actions / Build closures with ColmenaInvalid workflow file
|
||
- id: matrix | ||
name: "Run nix eval to generate node list" | ||
run: | | ||
JSON=$(nix eval .#colmena --no-substitute -apply 'with builtins; x: filter (f: !elem f [ "defaults" "meta" ]) (attrNames x)' --json) | ||
echo "matrix=$JSON" >> $GITHUB_OUTPUT | ||
build: | ||
runs-on: ubuntu-latest | ||
name: "Build node" | ||
needs: generate_matrix | ||
strategy: | ||
# each closure is independent from each other | ||
fail-fast: false | ||
matrix: | ||
node: ${{ fromJSON(needs.generate_matrix.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/bootstrap.yml | ||
secrets: inherit | ||
- name: Build ${{ matrix.node }} | ||
run: | | ||
nix run nixpkgs#colmena -- build --no-build-on-target -v --on ${{ matrix.node }} |