ci: re-introduce github actions #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
jobs: | |
get-x86_64-hosts: | |
runs-on: self-hosted-x86_64-linux | |
steps: | |
- name: repository checkout | |
uses: actions/checkout@v4 | |
- name: output-hosts | |
run: | | |
{ | |
echo 'HOSTS_JSON_X86_64<<EOF' | |
nix eval -I nixpkgs=$(nix flake metadata nixpkgs --json | jq -r .path) --raw --impure --expr ' | |
with import <nixpkgs> { }; | |
builtins.toJSON (lib.mapAttrsToList (n: v: n) | |
(lib.attrsets.filterAttrs (n: v: v.pkgs.system == pkgs.system) | |
(builtins.getFlake(builtins.toString ./.)).outputs.nixosConfigurations))' | |
echo "" | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
get-aarch64-hosts: | |
runs-on: self-hosted-aarch64-linux | |
steps: | |
- name: repository checkout | |
uses: actions/checkout@v4 | |
- name: output-hosts | |
run: | | |
{ | |
echo 'HOSTS_JSON_AARCH64<<EOF' | |
nix eval -I nixpkgs=$(nix flake metadata nixpkgs --json | jq -r .path) --raw --impure --expr ' | |
with import <nixpkgs> { }; | |
builtins.toJSON (lib.mapAttrsToList (n: v: n) | |
(lib.attrsets.filterAttrs (n: v: v.pkgs.system == pkgs.system) | |
(builtins.getFlake(builtins.toString ./.)).outputs.nixosConfigurations))' | |
echo "" | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
build-nixos-x86_64-linux: | |
runs-on: self-hosted-x86_64-linux | |
needs: get-x86_64-hosts | |
strategy: | |
matrix: | |
host: ${{fromJSON(needs.get-x86_64-hosts.outputs.hosts)}} | |
steps: | |
- name: repository checkout | |
uses: actions/checkout@v4 | |
- name: build host configuration ${{ matrix.host }} | |
run: | | |
nixos-rebuild build --verbose --flake ".#${{ matrix.host }}" | |
build-nixos-aarch64-linux: | |
runs-on: self-hosted-aarch64-linux | |
needs: get-aarch64-hosts | |
strategy: | |
matrix: | |
host: ${{fromJSON(needs.get-aarch64-hosts.outputs.hosts)}} | |
steps: | |
- name: repository checkout | |
uses: actions/checkout@v4 | |
- name: build host configuration ${{ matrix.host }} | |
run: | | |
nixos-rebuild build --verbose --flake ".#${{ matrix.host }}" |