Skip to content

gha: attempt to minimize CI time #62

gha: attempt to minimize CI time

gha: attempt to minimize CI time #62

Workflow file for this run

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
with:
CACHIX_KEY: ${{ secrets.CACHIX_KEY }}
- 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
with:
CACHIX_KEY: ${{ secrets.CACHIX_KEY }}
- name: Build ${{ matrix.node }}
run: |
nix run nixpkgs#colmena -- build --no-build-on-target -v --on ${{ matrix.node }}