Skip to content

Commit

Permalink
gha: attempt to minimize CI time
Browse files Browse the repository at this point in the history
  • Loading branch information
itslychee committed Jun 8, 2024
1 parent c7c7317 commit baea511
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
22 changes: 22 additions & 0 deletions .github/actions/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup build environment for Nix
jobs:
bootstrap:
name: "Generate bootstrap environment"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install QEMU
run: |
sudo apt update -q -y
sudo apt install -q -y binfmt-support qemu-efi qemu-system-aarch64 qemu-user-static
- 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 }}'
34 changes: 7 additions & 27 deletions .github/workflows/closures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,17 @@ jobs:
run: |
JSON=$(nix eval .#colmena --apply 'with builtins; x: filter (f: !elem f [ "defaults" "meta" ]) (attrNames x)' --json)
echo "matrix=$JSON" >> $GITHUB_OUTPUT
bootstrap:
name: "Generate bootstrap environment"
needs: generate_matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install QEMU
run: |
sudo apt update -q -y
sudo apt install -q -y binfmt-support qemu-efi qemu-system-aarch64 qemu-user-static
- 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 }}'
build:
name: "Build node"
needs: bootstrap
needs: generate_matrix
strategy:
# each closure is independent from each other
fail-fast: false
matrix:
node: ${{ fromJSON(needs.bootstrap.needs.generate_matrix.outputs.matrix) }}
steps:
- name: Build ${{ matrix.node }}
run: |
nix run nixpkgs#colmena -- build --no-build-on-target -v --on ${{ matrix.node }}
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 }}

0 comments on commit baea511

Please sign in to comment.