infra/.forgejo/workflows/check.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.1 KiB
YAML
Raw Normal View History

name: Flake checks
2024-05-30 14:45:40 +00:00
on:
pull_request:
push:
branches:
- feat/mail-tankstelle
jobs:
Check:
runs-on: self-hosted
steps:
- name: Check out repository code
uses: https://code.forgejo.org/actions/checkout@v4
- name: Check formatting
run: |
nix --accept-flake-config --access-tokens '' develop --command treefmt --fail-on-change
- name: Run flake checks
run: |
set -exuo pipefail
2024-04-23 14:00:16 +00:00
# Prevent cache garbage collection by creating GC roots
mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results
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 '' \
build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$target" ".#nixosConfigurations.${target}.config.system.build.toplevel"
done
2024-04-23 14:00:16 +00:00
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check