nibylandia/.github/workflows/ci.yml

60 lines
1.9 KiB
YAML

name: CI
on:
push:
branches: [main]
jobs:
get-hosts:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
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="
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)'
echo ""
} >> "$GITHUB_OUTPUT"
x86_64-linux:
if: |
!contains(github.event.head_commit.message, '[skip-ci x64]')
&& !contains(github.event.head_commit.message, '[skip-ci]')
runs-on: self-hosted-x86_64-linux
needs: [get-hosts]
strategy:
fail-fast: false
matrix:
host: ${{ fromJson(needs.get-hosts.outputs.matrix).x86_64-linux }}
steps:
- name: repository checkout
uses: actions/checkout@v4
- name: build host configuration ${{ matrix.host }}
run: nixos-rebuild build --verbose --flake ".#${{ matrix.host }}"
aarch64-linux:
if: |
!contains(github.event.head_commit.message, '[skip-ci arm64]')
&& !contains(github.event.head_commit.message, '[skip-ci]')
runs-on: self-hosted-aarch64-linux
needs: [get-hosts]
strategy:
fail-fast: false
matrix:
host: ${{ fromJson(needs.get-hosts.outputs.matrix).aarch64-linux }}
steps:
- name: repository checkout
uses: actions/checkout@v4
- name: build host configuration ${{ matrix.host }}
run: nixos-rebuild build --verbose --flake ".#${{ matrix.host }}"