ci: run make check on every push and pull request #49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/forgejo-ci"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
castrum's fast gate,
make check(yamllint, ShellCheck, ansible-lint,the playbook syntax check and the repository's gate scripts), ran only
when a contributor remembered to run it before a push. A forgotten run
let a lint finding or a broken gate reach
mainunseen, to be found bythe next contributor whose own run failed on someone else's change. The
forge now has runners, so it can run the gate itself.
Running
make test(molecule) in CI as well was set aside for now: itneeds rootless podman and a raised inotify limit on the runner. Any
deployment from CI was set aside too, since it would put SSH keys and
vault passwords for every tenant on the runner.
What changed
Before, nothing ran on a push. Now every push to
main, and everypull request against it, runs
make setup && make checkon arunner labelled
docker, and reports the result as a commit status.The job runs in
node:22-trixie, pinned by digest: Node serves thecheckout action, and its system
python3withpython3-aptlets thedocker_enginegate run itspython3-debiancase. The checkout actioncomes from code.forgejo.org, pinned by commit, and does not leave the
job's token in
.git/configfor the codemake setupfetches. Thejob uses no secret.
CONTRIBUTING.md#running-the-gatesnow says what the forge runs andwhat stays local, and
AGENTS.mddrops its "nothing runs the gatesautomatically" clause. The workflow lives in
.forgejo/workflows/check.yml.The first run found
make checkfailing under ShellCheck 0.10, theversion Debian 13 ships: it reports
tests/molecule/run.sh's trap-onlyhandler as SC2317, where 0.11 says SC2329, the only one the script
disabled. The script now disables both.
How to verify
Have a Forgejo account that can push to this repository, and a
runner with the
dockerlabel registered for it.The problem, on
main: open a pull request from any scratch branchagainst
main; it shows no status check.The solution: from this branch, make a scratch branch, break one
gate and push it:
Open a pull request from
ci-trial-redagainstmain. Thecheckworkflow's run fails at the "Run the fast gate" step,
with yamllint naming
broken.yml. This pull request's own runpasses, its log shows each
== gate:line, and it has nopython3-debian case not runline. Close it and deleteci-trial-redafterwards.make checkpassed locally on each commit, and the forge's run onthis pull request passed after the ShellCheck fix. Not tried: the red
run of step 3;
make test, since the change touches no role.Considerations
The sentence "
mainaccepts only a change whose run has passed" inCONTRIBUTING becomes true only once
main's existing protection rulerequires this workflow's
pull_requeststatus, so merge after that isset. Pushes run the job only on
main, so a pull request's branchruns it once, for the pull request event. The image digest and the
action's commit are bumped by hand, as the workflow's comment says.