feat(ci): add shellcheck and PyYAML to the ci tool set
test-runner / smoke (push) Successful in 1s

work/pxe-infra-automation is adding a Gitea Actions pipeline, and its
checks live in ci/check.sh: shellcheck over the build scripts AND over
the guest payload (image/*.sh, which is copied into the image verbatim),
plus a YAML validation of the workflow files.

That script exits 2 when shellcheck is missing, so on this runner —
where the job PATH is frozen into the systemd unit at activation time
and cannot gain a package without a nixos-rebuild — the linter has to
come from the ci devshell instead. shellcheck is now in lib/ci-tools.nix,
which is the single list both consumers use (the runner's hostPackages
and the devshell), so the two cannot drift apart.

The same list's plain python3 has no PyYAML, and ci/check.sh treats
the YAML validation as optional (it warns and skips). Wrapping python3
with PyYAML makes 'import yaml' work, so the validation actually runs
rather than silently skipping.

The nixos repo's own flake.lock pins nixpkgs; the pipeline uses that
revision instead of a floating nixos-unstable, because the nix registry
on sapphira is empty and 'nixpkgs#...' cannot resolve there.
This commit is contained in:
oqyude committed 2026-10-20 16:16:49 +03:00
1 parent 4940a1e287
commit 715cafdf18
1 file changed
+15
+15
View File
@@ -29,4 +29,19 @@ with pkgs; [
# no PowerShell otherwise, and `nix-shell -p powershell` is not a fallback
# here: the nix registry on sapphira is empty, so -p cannot resolve nixpkgs.
powershell
# work/pxe-infra-automation runs shellcheck over the build scripts AND
# over the guest payload (image/*.sh, which is copied into the image
# verbatim). Its CI lives in .gitea/workflows/ci.yml and calls
# `bash ci/check.sh`; that script exits 2 when shellcheck is missing, so
# the linter has to be reachable or the job can only ever fail.
shellcheck
# The same repository's CI validates the YAML of its workflow files with
# python3 + PyYAML. The stock `python3` above has no PyYAML, and the
# check is optional in ci/check.sh -- it warns and skips when the module
# is absent. Wrapping python3 with PyYAML makes `import yaml` work in
# the devshell (and in the runner's hostPackages after the next
# nixos-rebuild), so the validation actually runs instead of skipping.
python3.withPackages (ps: [ ps.pyyaml ])
]