gha: attempt to minimize CI time #34
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: | ||
name: "Generate hive list" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.matrix.outputs.matrix }} | ||
steps: | ||
- uses: DeterminateSystems/nix-installer-action@v4 | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: actions/checkout@v4 | ||
- id: matrix | ||
name: "Run nix eval to generate node list" | ||
run: | | ||
JSON=$(nix eval .#colmena --apply 'with builtins; x: filter (f: !elem f [ "defaults" "meta" ]) (attrNames x)' --json) | ||
echo "matrix=$JSON" >> $GITHUB_OUTPUT | ||
build: | ||
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: ./.github/actions/bootstrap.yml | ||
- name: Build ${{ matrix.node }} | ||
run: | | ||
nix run nixpkgs#colmena -- build --no-build-on-target -v --on ${{ matrix.node }} |