vm-nightly: one job per test, with a lint that keeps the matrix list in step
A stuck test in the shared job was cut at the runner's one-hour limit and hid the other tests' results. The matrix list is static; check-vm-test-list.sh fails CI when it differs from nix/vm-tests.nix.
This commit is contained in:
parent
cead194b2a
commit
d3e15c7fbe
1 changed files with 96 additions and 26 deletions
|
|
@ -2,16 +2,26 @@ name: vm-nightly
|
|||
|
||||
# Builds the `vmTests` flake output: tests that boot NixOS VMs and need KVM.
|
||||
# They are not `checks`, so the per-PR `nix flake check` job never runs them.
|
||||
# Nightly plus manual dispatch; a failing test fails the run, which the forge
|
||||
# Nightly plus manual dispatch; a failing test fails its job, which the forge
|
||||
# shows as a failed scheduled run.
|
||||
#
|
||||
# One job per test. The runner kills a job after its `jobTimeout` (one hour by
|
||||
# default) and reports nothing for it, so a stuck test in a shared job would
|
||||
# erase the others' results. Each test's `globalTimeout` stays below that hour.
|
||||
#
|
||||
# The matrix list is static: a matrix built from a `needs` output needs
|
||||
# Forgejo 14 and a matching runner, and this runner is gitea-actions-runner.
|
||||
# `scripts/check-vm-test-list.sh` fails CI when the list differs from
|
||||
# `nix/vm-tests.nix`.
|
||||
#
|
||||
# Run one by hand from the forge UI (Actions, vm-nightly, "Run workflow",
|
||||
# `test` input) or locally with `nix build .#vmTests.x86_64-linux.<name>`.
|
||||
# With `test` set, every other matrix job skips its steps and ends green.
|
||||
#
|
||||
# ⚠️ The hour is deliberate: at the default job capacity of 1
|
||||
# (`services.hyperhive.deploy.ci-runner.concurrency`) this job holds the
|
||||
# runner for its whole run and everything else queues behind it. It sits
|
||||
# between coverage (02:00) and flake-update (03:00).
|
||||
# (`services.hyperhive.deploy.ci-runner.concurrency`) the matrix jobs run one
|
||||
# after another and hold the runner until the last ends; everything else
|
||||
# queues behind them. It sits between coverage (02:00) and flake-update (03:00).
|
||||
#
|
||||
# Separate from ci.yml because a `workflow_dispatch` trigger there fires every
|
||||
# job in that file, and this must not run per pull request.
|
||||
|
|
@ -27,24 +37,26 @@ on:
|
|||
- cron: "30 2 * * *"
|
||||
|
||||
jobs:
|
||||
vm-tests:
|
||||
name: nix build vmTests
|
||||
vm-test:
|
||||
name: vm test ${{ matrix.test }}
|
||||
if: vars.PUBLIC_FORGE != 'true'
|
||||
runs-on: ${{ vars.PUBLIC_FORGE == 'true' && 'nixos' || 'hive-ci' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test:
|
||||
- agent-ephemeral-rootfs
|
||||
- hive-squid
|
||||
- hive-egress-antispoof
|
||||
- swarm-archive
|
||||
- swarm-builder-offline
|
||||
- full-setup
|
||||
- semi-spread
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
if: inputs.test == '' || inputs.test == matrix.test
|
||||
- name: build
|
||||
if: inputs.test == '' || inputs.test == matrix.test
|
||||
env:
|
||||
TEST: ${{ inputs.test }}
|
||||
run: |
|
||||
set -eu
|
||||
system=x86_64-linux
|
||||
tests="$TEST"
|
||||
if [ -z "$tests" ]; then
|
||||
tests="$(nix eval --raw ".#vmTests.$system" --apply 'ts: builtins.concatStringsSep " " (builtins.attrNames ts)')"
|
||||
fi
|
||||
set --
|
||||
for t in $tests; do
|
||||
set -- "$@" ".#vmTests.$system.$t"
|
||||
done
|
||||
nix build --no-link --keep-going --print-build-logs "$@"
|
||||
TEST: ${{ matrix.test }}
|
||||
run: nix build --no-link --print-build-logs ".#vmTests.x86_64-linux.$TEST"
|
||||
|
|
|
|||
Loading…
Reference in a new issue