feat(deploy): the CI runner's window by hand, halkyon-ci-now (ADR 0039, D6)
Some checks failed
CI / check (push) Failing after 7m35s

Rests the heavy sidecars, runs every queued job, then stops the runner and
starts the sidecars again however it ends; from melchior through
systemd-run, so a closed laptop doesn't end it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-10 20:14:20 +01:00
commit 776b80e6ae
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -154,6 +154,48 @@ void main() {
});
});
group('a window by hand (halkyon-ci-now)', () {
final script = read('deploy/runner/ci-now.sh');
test('rests the heavy sidecars around the runner, unless asked to keep '
'them', () {
expect(script, contains('systemctl start halkyon-night'));
expect(script, contains('systemctl start halkyon-morning'));
expect(script, contains('--keep-sidecars'));
});
test('stops the runner and starts the sidecars again however it ends: '
'done, interrupted, stopped or its SSH session gone', () {
final trap = RegExp(
r'^trap (\S+) (.*)$',
multiLine: true,
).firstMatch(script);
expect(trap, isNotNull);
expect(trap![2]!.split(' '), containsAll(['EXIT', 'INT', 'TERM', 'HUP']));
final restore = RegExp(
'^${trap[1]}\\(\\) \\{([^}]*)\\}',
multiLine: true,
).firstMatch(script)![1]!;
expect(restore, contains('systemctl stop forgejo-runner'));
expect(restore, contains('systemctl start halkyon-morning'));
});
test('leaves the nightly window alone: refuses while the runner runs', () {
expect(script, contains('systemctl is-active --quiet forgejo-runner'));
});
test(
"is installed by host step 7, root's own, never deploy's checkout",
() {
final readme = read('deploy/host/README.md');
expect(
readme,
contains('deploy/runner/ci-now.sh /usr/local/sbin/halkyon-ci-now'),
);
},
);
});
group('the workflow', () {
final workflow = loadYaml(read('.forgejo/workflows/ci.yaml')) as YamlMap;
final jobs = workflow['jobs'] as YamlMap;