2024-02-25 20:44:28 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
2024-03-19 12:45:09 +00:00
|
|
|
get-hosts:
|
2024-03-26 07:11:42 +00:00
|
|
|
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
|
2024-02-25 20:44:28 +00:00
|
|
|
runs-on: self-hosted-x86_64-linux
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.hosts_out.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
- name: repository checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- id: hosts_out
|
|
|
|
name: set hosts var
|
|
|
|
run: |
|
|
|
|
{
|
|
|
|
echo -n "matrix="
|
2024-03-19 12:45:09 +00:00
|
|
|
nix eval --raw --impure --expr '
|
|
|
|
let
|
|
|
|
f = configs: builtins.groupBy (n: configs.${n}.pkgs.system) (builtins.attrNames configs);
|
|
|
|
in
|
|
|
|
builtins.toJSON (f (builtins.getFlake(builtins.toString ./.)).outputs.nixosConfigurations)'
|
2024-02-25 20:44:28 +00:00
|
|
|
echo ""
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
|
2024-03-19 12:45:09 +00:00
|
|
|
x86_64-linux:
|
2024-03-26 07:25:31 +00:00
|
|
|
if: |
|
|
|
|
!contains(github.event.head_commit.message, '[skip-ci x64]')
|
2024-03-26 07:38:11 +00:00
|
|
|
&& !contains(github.event.head_commit.message, '[skip-ci]')
|
2024-02-25 20:44:28 +00:00
|
|
|
runs-on: self-hosted-x86_64-linux
|
2024-03-19 12:45:09 +00:00
|
|
|
needs: [get-hosts]
|
2024-02-25 20:44:28 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-03-19 12:45:09 +00:00
|
|
|
host: ${{ fromJson(needs.get-hosts.outputs.matrix).x86_64-linux }}
|
2024-02-25 20:44:28 +00:00
|
|
|
steps:
|
|
|
|
- name: repository checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: build host configuration ${{ matrix.host }}
|
|
|
|
run: nixos-rebuild build --verbose --flake ".#${{ matrix.host }}"
|
|
|
|
|
2024-03-19 12:45:09 +00:00
|
|
|
aarch64-linux:
|
2024-03-26 07:25:31 +00:00
|
|
|
if: |
|
|
|
|
!contains(github.event.head_commit.message, '[skip-ci arm64]')
|
2024-03-26 07:38:11 +00:00
|
|
|
&& !contains(github.event.head_commit.message, '[skip-ci]')
|
2024-02-25 20:44:28 +00:00
|
|
|
runs-on: self-hosted-aarch64-linux
|
2024-03-19 12:45:09 +00:00
|
|
|
needs: [get-hosts]
|
2024-02-25 20:44:28 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-03-19 12:45:09 +00:00
|
|
|
host: ${{ fromJson(needs.get-hosts.outputs.matrix).aarch64-linux }}
|
2024-02-25 20:44:28 +00:00
|
|
|
steps:
|
|
|
|
- name: repository checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: build host configuration ${{ matrix.host }}
|
|
|
|
run: nixos-rebuild build --verbose --flake ".#${{ matrix.host }}"
|