Skip to content

ci(docker): pull the network test image from GHCR instead of building it - #126

Merged
stewartadam merged 1 commit into
mainfrom
claude/project-thread-6hb8tj
Nov 26, 2026
Merged

stewartadam merged 1 commit into
mainfrom
claude/project-thread-6hb8tj

Conversation

@stewartadam

Copy link
Copy Markdown
Contributor

The IPv4 and IPv6 network test jobs built the Docker image on every run, about 1m45s of each job, mostly spent compiling cargo-llvm-cov and the tests inside the image (the baked-in test build wasn't even used, since CI runs the tests from the mounted checkout).

What changed

  • docker-linux/Dockerfile now has two stages:
    • env: the test environment without the sources: Rust at the rust-toolchain.toml version, iproute2, llvm-tools and cargo-llvm-cov.
    • the default stage builds on env and adds the sources and test build, so local docker build / docker run works as before. It now always includes cargo-llvm-cov, so the COVERAGE build argument is gone.
  • CI publishes the env stage to ghcr.io/rustlight/sacn/test-env, tagged with hashFiles('docker-linux/Dockerfile', 'rust-toolchain.toml'). The new docker-linux/ci_image.sh pulls that tag, and only when it's missing builds the image and pushes it. So the image is rebuilt only when the Dockerfile or the toolchain pin changes.
  • The two test jobs get packages: write to push. Pull requests from forks only get a read token, so they build the image themselves (same as today) instead of pushing. A failed push is a warning, not a failure.
  • CONTRIBUTING.md describes the published image and drops the COVERAGE=1 build.

No new actions, so actions.lock is unchanged; everything is plain docker commands.

After merging

The first run that pushes creates the test-env package, private by default. Same-repo runs can pull it with GITHUB_TOKEN either way, but making it public (package settings → Change visibility) lets fork PRs and contributors pull it too instead of building.

Testing

  • Built both stages locally and ran run_coverage.sh unit in the env image from a mounted checkout: pinned 1.100.0 toolchain, cargo-llvm-cov 0.9.1 and llvm-tools present, coverage report produced.
  • Ran ci_image.sh with no registry access: the pull fails and it falls back to building.
  • zizmor and rumdl pass; actionlint runs in this PR's CI.
  • This PR's own CI run builds and pushes the image (the tag is new); a re-run should pull it instead.

Generated by Claude Code

@stewartadam stewartadam self-assigned this Nov 26, 2026
The IPv4 and IPv6 test jobs built the Docker image on every run, about
1m45s each, mostly installing cargo-llvm-cov from source. The Dockerfile
now has an `env` stage with the test environment but no sources (pinned
Rust, iproute2, llvm-tools, cargo-llvm-cov). CI publishes it to
ghcr.io/rustlight/sacn/test-env, tagged with a hash of the Dockerfile and
rust-toolchain.toml, and the jobs pull it; docker-linux/ci_image.sh builds
and pushes it only when the tag is missing. Fork pull requests, which
can't push packages, build it themselves.

The default stage still bakes in the sources for local `docker run`, and
now always includes cargo-llvm-cov, so the COVERAGE build argument is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVQfdzX3i2tYqceNyqr
@stewartadam
stewartadam force-pushed the claude/project-thread-6hb8tj branch from 42a5e1a to 2c3c255 Compare November 26, 2026 10:14
@stewartadam
stewartadam enabled auto-merge (squash) November 26, 2026 10:14
@stewartadam
stewartadam disabled auto-merge November 26, 2026 10:18
@stewartadam
stewartadam merged commit 44b2450 into main Nov 26, 2026
12 checks passed
@stewartadam
stewartadam deleted the claude/project-thread-6hb8tj branch November 26, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants