perf(ci): run Lint and Build in the baked ci image #8

Merged
Defame1297 merged 3 commits from feat/use-ci-image into main 2026-10-25 12:00:02 +00:00
Owner

Why

Lint (86s) and Build (50s) install OS packages, the pinned Python tools and every pre-commit hook environment on each run. The ci image (images/ci, published by image.yml) has all of that baked in.

Change

  • lint.yml and build.yml: container.image is git.rkdr.net/mortis/ci:0.1.0@sha256:f8925ce9024cb317f052545da6fc90369218962be636e683b6969e0779847d6a (tag for the release, digest is what is enforced; bump both together when image.yml publishes a new version). The OS-package and venv steps are gone; PRE_COMMIT_HOME=/opt/pre-commit.
  • New step after the checkout, in both: sha256sum --quiet -c /opt/ci-pins.sha256. If this change touches requirements-dev.txt or .pre-commit-config.yaml the check fails, the job warns and runs pip install -r requirements-dev.txt into /opt/venv (pre-commit builds the hook environments it is missing on demand): slower, same result as before.
  • The secret scan finds gitleaks under $PRE_COMMIT_HOME.
  • image.yml: wrap the registry Accept header (yamllint line-length failed Lint on main after #7: 168 > 160).

What this run will show

Workflow files of a pull request come from its head, so this PR's own Lint and Build runs already use the new container. They show: that the runner can pull the image anonymously (the package is under the public org; if the pull is refused the job fails at startup and the runner needs registry credentials), the time saved (compare with 86s / 50s), and that ansible-test sanity now also runs on Python 3.11 and 3.13.

Not covered

ansible-test sanity --requirements still installs its per-test virtualenvs each run (about 25s of Build): a prewarm against a stub collection is a separate change.

🤖 Generated with Claude Code

## Why Lint (86s) and Build (50s) install OS packages, the pinned Python tools and every pre-commit hook environment on each run. The `ci` image (`images/ci`, published by `image.yml`) has all of that baked in. ## Change - `lint.yml` and `build.yml`: `container.image` is `git.rkdr.net/mortis/ci:0.1.0@sha256:f8925ce9024cb317f052545da6fc90369218962be636e683b6969e0779847d6a` (tag for the release, digest is what is enforced; bump both together when `image.yml` publishes a new version). The OS-package and venv steps are gone; `PRE_COMMIT_HOME=/opt/pre-commit`. - New step after the checkout, in both: `sha256sum --quiet -c /opt/ci-pins.sha256`. If this change touches `requirements-dev.txt` or `.pre-commit-config.yaml` the check fails, the job warns and runs `pip install -r requirements-dev.txt` into `/opt/venv` (pre-commit builds the hook environments it is missing on demand): slower, same result as before. - The secret scan finds gitleaks under `$PRE_COMMIT_HOME`. - `image.yml`: wrap the registry `Accept` header (yamllint `line-length` failed Lint on `main` after #7: 168 > 160). ## What this run will show Workflow files of a pull request come from its head, so this PR's own Lint and Build runs already use the new container. They show: that the runner can pull the image anonymously (the package is under the public org; if the pull is refused the job fails at startup and the runner needs registry credentials), the time saved (compare with 86s / 50s), and that `ansible-test sanity` now also runs on Python 3.11 and 3.13. ## Not covered `ansible-test sanity --requirements` still installs its per-test virtualenvs each run (about 25s of Build): a prewarm against a stub collection is a separate change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 3 commits 2026-10-25 11:57:42 +00:00
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
The job container is git.rkdr.net/mortis/ci:0.1.0, pinned by tag and digest. It
carries git, shellcheck, the pinned Python tools (/opt/venv) and every
pre-commit hook environment (/opt/pre-commit). After the checkout the job
compares the pin files with the checksums recorded in the image; on a
mismatch (a PR that changes a pin) it installs the pinned tools for this run,
as before, and pre-commit builds the hook environments it is missing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
perf(build): run in the ci image instead of installing the tools every run
Lint / lint (pull_request) Successful in 5s
Build / build (pull_request) Successful in 37s
8437e7cb66
Same container and pin check as lint.yml.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 merged commit be673b266d into main 2026-10-25 12:00:02 +00:00
Defame1297 deleted branch feat/use-ci-image 2026-10-25 12:00:02 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#8