Skip to content

ci: build e2e image via the production native-build path#934

Merged
scarmuega merged 1 commit into
mainfrom
ci/e2e-reuse-image-build
Jun 14, 2026
Merged

ci: build e2e image via the production native-build path#934
scarmuega merged 1 commit into
mainfrom
ci/e2e-reuse-image-build

Conversation

@scarmuega

@scarmuega scarmuega commented Jun 14, 2026

Copy link
Copy Markdown
Member

Context

Follow-up to #933 (the new docker.yml). The e2e build job compiled oura from source inside Docker using the root Dockerfile, while docker.yml builds the binary natively and assembles the thin .github/image/Dockerfile. So e2e was validating a different image from the one we actually publish, and paying a cold from-source build each dispatch.

What this does

Refactors the e2e build job to mirror docker.yml's build path:

  • Native cargo build --target x86_64-unknown-linux-gnu --all-features --locked --release (rustup honoring rust-toolchain.toml + arduino/setup-protoc).
  • Stages the binary as .github/image/bin/oura-Linux-amd64 and builds with context: .github/image — the same runtime image production ships.
  • Reuses Swatinem/rust-cache with shared-key: docker-x86_64-unknown-linux-gnu, so e2e dispatches restore the warm cache docker.yml populates from main instead of compiling cold.

Net effects:

  • Correctness — e2e now exercises the production image, not a divergent from-source build.
  • Speed — warm Rust cache + the image build is now just a binary copy (the old cache-from/to: type=gha Docker-layer cache is no longer needed and was removed).

Scope

  • Only the build job changed; the test matrix is untouched.
  • Stays workflow_dispatch-only — no trigger changes, not wired into the release.

Caveat

On a branch dispatch with large dependency changes, the shared cache restores from main, so a partial rebuild is still possible — same trade-off as docker.yml itself.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized continuous integration build pipeline with improved Docker image staging and enhanced build caching for faster, more efficient deployment cycles.

The e2e build job compiled oura from source inside Docker using the root
Dockerfile, diverging from the image docker.yml actually publishes. Build
the amd64 binary natively (rustup + setup-protoc + Swatinem cache) and
assemble it with the shared .github/image/Dockerfile, so e2e exercises the
production image. Reusing docker.yml's rust-cache shared-key lets e2e
dispatches restore a warm cache instead of a cold from-source build.

Stays workflow_dispatch-only; the test job is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega requested a review from paulobressan as a code owner June 14, 2026 00:27
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The e2e workflow build job is updated to compile the Rust binary explicitly using cargo build for x86_64-unknown-linux-gnu, with Rust toolchain, Protoc, and rust-cache setup steps added. The resulting binary is staged into .github/image/bin/, and the Docker build context is changed from . to .github/image.

Changes

E2E CI: Explicit Rust Build and Docker Context Update

Layer / File(s) Summary
Rust build steps and Docker context update
.github/workflows/e2e.yaml
Adds Rust toolchain install, Protoc install via arduino/setup-protoc, Rust compilation cache restore via Swatinem/rust-cache keyed to docker-x86_64-unknown-linux-gnu, a cargo build --release step targeting x86_64-unknown-linux-gnu, and a binary staging step that moves the compiled binary to .github/image/bin/oura-Linux-amd64. The Docker build/push step's context is updated from . to .github/image, and cache-from/cache-to Docker layer cache config is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • paulobressan

Poem

🐇 Hoppin' through the CI lane,
Cargo builds the binary plain,
Protoc ready, cache restored,
Docker context — .github/image stored.
No more root, just what we need,
A tidy image, built with speed! 🦀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: refactoring the e2e CI workflow to build the image via the production native-build path instead of compiling from source in Docker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/e2e-reuse-image-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@scarmuega scarmuega merged commit e474c08 into main Jun 14, 2026
11 of 12 checks passed
@scarmuega scarmuega deleted the ci/e2e-reuse-image-build branch June 14, 2026 00:28
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.

1 participant