Four of the merge gate's thirteen members existed only as inline workflow shell,
so a developer could not run them without copying YAML out of a workflow file:
actionlint, shellcheck, the chart render and govulncheck. Each is now a target in
make/checks.mk, and the workflows call the target instead of holding a second
copy of the commands. chart.yml drops from four steps to one.
Also adds root `fmt` and `lint`, which loop the modules. `make lint` at the root
previously failed with "No rule to make target", which is the most surprising
thing a newcomer meets, given all six modules have had a lint target all along.
CI keeps calling the module targets directly, so its seven lint jobs stay
parallel.
`make gate` runs the members that work on a laptop and names the four that do
not, with the command and the reason for each.
Two bugs found while testing, both of the kind that reports success while
checking nothing.
The shellcheck collector used `mapfile -d ''`, a bash 4.4 builtin. On macOS bash
3.2 it fails, leaves the array empty and exits 0, so a target copying it would
lint zero files and pass. The collector moves to hack/shell-scripts.sh, which
emits a NUL list for `xargs -0` and needs no bash 4. shellcheck.yml now calls it
too, so there is one definition instead of three.
kubeconform selects input files by extension, and `mktemp -t nke-chart-XXXXXX`
on macOS appends random characters after the template. The rendered manifest
landed at nke-chart-XXXXXX.qlKjrjG4RL, kubeconform skipped it, and the summary
read "0 resource found in 0 file" while lint-chart reported success. It now
renders into a temporary directory as rendered.yaml, and validates 11 of 11.
chart.yml keeps its kubeconform install step. The target skips validation and
says so when the tool is absent, which on a runner would silently drop a real
check.
Every tool is taken from PATH, and a missing one reports which tool, the version
CI uses, and both a flox and a non-flox way to get it. Nothing here requires
flox.
Signed-off-by: Davanum Srinivas <dsrinivas@nvidia.com>