redo GHA in hopes to make it more performant #70
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: ./.github/actions/bootstrap | |
with: | |
CACHIX_KEY: ${{ secrets.CACHIX_KEY }} | |
- id: matrix | |
name: "Run nix eval to generate node list" | |
run: | | |
JSON=$(nix eval github:itslychee/config#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: | |
- name: Install QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64 | |
- uses: DeterminateSystems/nix-installer-action@v4 | |
name: Install Nix | |
with: | |
extra-conf: | | |
extra-platforms = aarch64-linux i686-linux | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- uses: cachix/cachix-action@v14 | |
name: Setup cachix | |
with: | |
name: lychee | |
authToken: ${{ secrets.CACHIX_KEY }} | |
skipAddingSubstituter: 'true' | |
installCommand: "nix profile install nixpkgs#cachix" | |
- uses: actions/checkout@v4 | |
- name: Build ${{ matrix.node }} | |
run: | | |
nix run nixpkgs#colmena -- build --no-build-on-target -v --on ${{ matrix.node }} -f github:itslychee/config |