ci: test gate, cargo-deny, Trivy scan, multi-arch, reproducible build, releases - #21
Merged
Conversation
Closes #9 Reproducible multi-stage Dockerfile (docker build . now works standalone), digest-pinned base images, and a test job gating the build. Bumped bytes/anyhow to clear two real RUSTSEC advisories cargo-deny caught. Tag pushes now cut a GitHub Release.
Fixes the module_inception warning clippy -D warnings now gates on in CI (added in this same PR), harmless before but a hard build failure now that the lint is enforced instead of just noted.
Building and pushing a multi-arch manifest on every merge (and every PR, unpublished) wasted CI time on QEMU arm64 compiles nobody used. Now PRs/main only build+scan single-arch; publishing (and latest) only happens on a real vX.Y.Z tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The old pipeline only built and pushed a Docker image: no tests, no lint, no dependency audit, no image scan, single-arch, and a Dockerfile that couldn't build standalone (
COPY target/release/signalrequired CI to have already runcargo buildoutside the container). This closes all of those gaps.Closes #9
Key Changes
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test,cargo-deny(advisories, licenses, bans, sources viadeny.toml)bytes1.11.0'sBytesMut::reserve) and RUSTSEC-2026-0190 (unsoundness inanyhow'sdowncast_mut). Bumped both (bytes1.11.0 to 1.12.1,anyhow1.0.100 to 1.0.104) in this PR.rust:1-slim-bookwormbuilder stage (dependency-compile layer cached separately from source changes), copies only the binary into thedebian:bookworm-slimruntime stage.docker build .now works standalone, verified locally.ignore-unfixed: true. Verified locally thatdebian:bookworm-slimcarries several HIGH/CRITICAL OS-package CVEs with no upstream fix (will_not_fix/fix_deferred, e.g.zlib1gCVE-2023-45853). Gating on those unconditionally would leave CI permanently red for nothing this project can act on. Anything with an actual available fix still fails the build.vX.Y.Ztag push, not on every main merge. PRs and main-branch pushes build and Trivy-scan a single-arch image for fast feedback, but nothing gets pushed and no QEMU/multi-arch build runs for an image that would just get thrown away.latestonly ever moves when a real version tag is pushed, so it always points at something actually released, not just "whatever's on main right now."linux/amd64,linux/arm64) via buildx + QEMU, only on the publish pathv*.*.*tag pushes now cut a GitHub Release (softprops/action-gh-release, auto-generated notes). The trigger existed before but nothing consumed it.checkoutv4 to v7,login-actionv3 to v4,metadata-actionv5 to v6,setup-buildx-actionv3 to v4,build-push-actionv5 to v7), verified against each action's own docs, not assumeddocker-publish.ymltoci.ymlto match what it now actually does-D warningsgate exposed:tests.rshad a redundantmod tests { ... }wrapper inside a file already included viamod tests;, harmless before, a hard clippy failure now thatmodule_inceptionis a fatal warning instead of a noteVerification
cargo test/clippy -D warnings/fmtall clean (28 tests, zero warnings after thetests.rsfix).cargo deny checkafter the dependency bumps:Built the new Dockerfile locally end to end:
(exits cleanly on missing config, confirming the binary itself runs correctly, not just that the image built)
Trivy against that same local image:
Out of Scope
No version tag is being pushed as part of this PR or issue. The first real
v1.0.0release happens only once every remaining issue (Helm chart, docs rewrite) is done and verified, this PR only makes sure the pipeline behaves correctly whenever that happens.