2023-10-29 22:52:33 +00:00
|
|
|
name: Flake checks
|
2023-11-10 18:10:22 +00:00
|
|
|
on: [pull_request]
|
2023-10-29 22:52:33 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
Check:
|
2024-05-29 15:45:23 +00:00
|
|
|
runs-on: self-hosted
|
2023-10-29 22:52:33 +00:00
|
|
|
steps:
|
2024-05-29 15:45:23 +00:00
|
|
|
- name: Check out repository code
|
|
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
2024-04-23 00:18:10 +00:00
|
|
|
|
2024-05-08 12:05:41 +00:00
|
|
|
- name: Check formatting
|
|
|
|
run: |
|
|
|
|
nix --accept-flake-config --access-tokens '' develop --command treefmt --fail-on-change
|
|
|
|
|
2023-10-29 22:52:33 +00:00
|
|
|
- name: Run flake checks
|
|
|
|
run: |
|
2024-05-14 21:22:09 +00:00
|
|
|
set -exuo pipefail
|
2024-04-23 14:00:16 +00:00
|
|
|
# Prevent cache garbage collection by creating GC roots
|
2024-05-30 14:29:32 +00:00
|
|
|
mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results
|
|
|
|
|
2024-04-23 10:03:16 +00:00
|
|
|
for target in $(nix flake show --json --all-systems | jq '
|
|
|
|
.["nixosConfigurations"] |
|
|
|
|
to_entries[] |
|
|
|
|
.key
|
|
|
|
' | tr -d '"'
|
|
|
|
); do
|
2024-04-23 14:00:16 +00:00
|
|
|
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \
|
2024-05-30 14:29:32 +00:00
|
|
|
build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$target" ".#nixosConfigurations.${target}.config.system.build.toplevel"
|
2024-04-23 10:03:16 +00:00
|
|
|
done
|
2024-04-23 14:32:11 +00:00
|
|
|
|
2024-04-23 14:00:16 +00:00
|
|
|
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check
|