split runners into separate arch types
Some checks failed
Build / nix-build (native-aarch64, fj-hetzner-aarch64-01) (push) Failing after 13s
Build / nix-build (native-x86_64, fj-shadowfax-01) (push) Failing after 12s

This commit is contained in:
Joseph Hanson 2024-07-25 11:05:47 -05:00
parent 17b3fba5f6
commit 9e806117ff
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 81 additions and 86 deletions

View file

@ -34,43 +34,24 @@ jobs:
- name: Garbage collect build dependencies
run: nix-collect-garbage
- name: Build new ${{ matrix.system }} system
- name: Build new ${{ matrix.system }} system and push to cachix
id: "build"
shell: bash
run: |
set -o pipefail
nix build \
".#top.${{ matrix.system }}" \
--profile ./profile \
--fallback \
-v \
--log-format raw \
> >(tee stdout.log) 2> >(tee /tmp/nix-build-err.log >&2)
- name: Push to Cachix
DRVOUT=$(nix build ".#deploy-json.${{ matrix.system }}" --print-out-paths)
::set-output name=build_output::$DRVOUT
- name: Push cache for ${{ matrix.system }} to cachix
id: "push-to-cachix"
if: success()
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
nix build .#deploy-json --print-out-paths | cachix push hsndev
nix-build-success:
if: ${{ always() }}
needs:
- nix-build
name: Nix Build Successful
runs-on: docker
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
name: Check matrix status
run: exit 1
deploy:
echo ${{steps.build_push.outputs.build_output}} | cachix push hsndev
- name: Deploy ${{ matrix.system }} runners
id: "deploy"
if: success()
needs:
- nix-build-success
runs-on: docker
env:
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
steps:
- name: Deploy Runners
run: |
spec=$(nix build .#deploy-json --print-out-paths)
cachix deploy activate $spec
cachix deploy activate ${{ steps.build_push.outputs.build_output }}

View file

@ -110,7 +110,10 @@
# Constructs a deploy.json output that can be used to deploy the runners
# https://docs.cachix.org/deploy/reference#deploy-json
deploy-json =
{
"aarch64-linux" =
let
inherit (common "aarch64-linux") cachix-deploy-lib;
in
@ -125,6 +128,15 @@
# system = "aarch64-linux";
imports = aarch64-linux-modules;
};
};
};
"x86_64-linux" =
let
inherit (common "x86_64-linux") cachix-deploy-lib;
in
cachix-deploy-lib.spec
{
agents = {
"fj-shadowfax-01" =
let
inherit (common "x86_64-linux") cachix-deploy-lib pkgs;
@ -134,6 +146,8 @@
};
};
};
};
# Convenience output that aggregates the outputs for home, nixos.
# Also used in ci to build targets generally.
top =