feat: use matrix for simpler and parallel host builds
Some checks failed
/ check (push) Waiting to run
/ build-host (beefcake) (push) Successful in 1m6s
/ build-host (dragon) (push) Successful in 1m30s
/ build-host (foxtrot) (push) Waiting to run
/ build-host (router) (push) Waiting to run
/ build-devshell (push) Waiting to run
/ build-host (flipflop) (push) Has been cancelled

Also some general cleanup of the workflow YAML
This commit is contained in:
Daniel Flanagan 2025-03-19 11:33:02 -05:00
parent b42b6011d8
commit ec76a76d54
2 changed files with 21 additions and 53 deletions

View file

@ -1,41 +1,25 @@
on: [push]
jobs:
check:
build-host:
runs-on: nixos-host
strategy:
matrix:
host:
- beefcake
- router
- dragon
- foxtrot
- flipflop
steps:
- uses: actions/checkout@v3
- name: Build host
run: |
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#${{ matrix.host }} --accept-flake-config
build-devshell:
runs-on: nixos-host
steps:
- name: Checkout
uses: actions/checkout@v3
# cache not needed since we now run on the host directly
# - name: Load cached nix store
# id: cache-nix-store
# uses: actions/cache/restore@v4
# with:
# path: /nix/store
# key: ${{ runner.os }}-nix-store
- name: Build server
run: |
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#beefcake --accept-flake-config
- name: Build router
run: |
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#router --accept-flake-config
- name: Build desktop
run: |
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#dragon --accept-flake-config
- name: Build laptop
run: |
nix shell nixpkgs#nixos-rebuild -c nixos-rebuild build --flake .#foxtrot --accept-flake-config
- uses: actions/checkout@v3
- name: Build default devShell
run: |
nix develop . --build
# - name: Save nix store
# uses: actions/cache/save@v4
# with:
# path: /nix/store
# key: ${{ steps.cache-nix-store.outputs.cache-primary-key }}
nix develop . --build --accept-flake-config

View file

@ -3,23 +3,7 @@ jobs:
check:
runs-on: nixos-host
steps:
- name: Checkout
uses: actions/checkout@v3
# cache not needed since we now run on the host directly
# - name: Load cached nix store
# id: cache-nix-store
# uses: actions/cache/restore@v4
# with:
# path: /nix/store
# key: ${{ runner.os }}-nix-store
- uses: actions/checkout@v3
- name: Check nix flake
run: |
nix flake check
# - name: Save nix store
# uses: actions/cache/save@v4
# with:
# path: /nix/store
# key: ${{ steps.cache-nix-store.outputs.cache-primary-key }}
nix flake check --accept-flake-config