The workflow could never run: it asked for 'runs-on: ubuntu-latest', but the only runner (gitea-runner-ci-sapphira) advertises exactly one label, 'native' (host executor). test-runner.yml used 'native' and runs; nix-checks never produced a single run. - runs-on: native - drop cachix/install-nix-action and 'nix profile install sops': the host profile already provides nix, sops, git and python3 - evaluate sapphira with 'nix eval --raw ...toplevel.drvPath' instead of 'nix build --dry-run': the runner user is not a Nix trusted user, so a dry-run build would want store write access; evaluation is the actual gate - timeout 15 min, concurrency cancel-in-progress
60 lines
2.7 KiB
YAML
60 lines
2.7 KiB
YAML
name: nixos flake checks
|
|
|
|
# Lives under .gitea/workflows/ because the only remote of this repo is
|
|
# gitea@git.zeroq.su (no GitHub remote), and Gitea Actions reads
|
|
# .gitea/workflows/ in preference to .github/workflows/. The copy that used
|
|
# to sit under .github/workflows/ therefore never ran a single step.
|
|
# See .agent/tasks/manifest.md T39.
|
|
#
|
|
# The only runner is gitea-runner-ci-sapphira, a *host-mode* executor on the
|
|
# machine this repo configures. It advertises exactly one label: `native`
|
|
# (`labels = [ "native:host" ]` in modules/server/gitea-runner.nix).
|
|
# Therefore `runs-on: ubuntu-latest` can never be scheduled — the job stays
|
|
# unassigned forever. Do not change this label unless the runner does.
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev, master]
|
|
pull_request:
|
|
branches: [main, dev, master]
|
|
workflow_dispatch:
|
|
|
|
# The runner is the host itself (2 cores / 5.6 GiB, ~20 production services).
|
|
# Evaluating all seven configurations cost 40+ minutes and pushed the host
|
|
# into swap, so superseded runs are cancelled instead of queued.
|
|
concurrency:
|
|
group: nix-checks-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
invariant-checks:
|
|
runs-on: native
|
|
# sapphira evaluation is a few minutes on an idle host. Hung-evaluation
|
|
# guard, not a budget (this used to allow 45).
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# nix, git, sops and python3 are already provided by the host profile;
|
|
# installing nix again inside the runner is wasted network + time.
|
|
- name: toolchain probe
|
|
run: |
|
|
nix --version
|
|
python3 --version
|
|
git --version
|
|
- name: run invariant checks (no full flake check)
|
|
# `--no-build` skips check #2 (`nix flake check`), which evaluates
|
|
# every host output. The runner *is* sapphira, so that sweep is both
|
|
# slow and self-harming here. It can still be run deliberately on a
|
|
# beefier machine, or locally with `bash .ci/checks.sh`.
|
|
run: bash .ci/checks.sh --no-build
|
|
# Only sapphira is evaluated on CI: it is the host the runner lives on,
|
|
# so a broken sapphira is an immediate CI-runner outage. Evaluation only
|
|
# (`drvPath`), not a build - the runner user is not a Nix trusted user
|
|
# and `nix build --dry-run` would still want store write access.
|
|
# Changes touching another host must be verified explicitly:
|
|
# nix build --no-link --dry-run .#nixosConfigurations.<host>.config.system.build.toplevel
|
|
- name: evaluate the sapphira configuration
|
|
run: |
|
|
nix --extra-experimental-features "nix-command flakes" eval --raw \
|
|
'.#nixosConfigurations.sapphira.config.system.build.toplevel.drvPath'
|