Repository navigation
ci: cache trusted build layers and npm downloads - #56
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the CI caching changes.
No open issues 🎉
What changed in this PR
This PR reduces repeated CI downloads by reusing Docker build layers and npm’s download cache while retaining lockfile-based dependency installation.
Changes:
- Build and load the development image with Buildx, restoring layers from the GitHub Actions cache.
- Restore npm downloads and run
npm ci --prefer-offlinewith a mounted cache directory. - Publish caches only on pushes to
mainafter all checks pass; PR workflows only restore caches.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Adds Docker layer and npm download caching with saves restricted to successful main builds. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
=======================================
Coverage 93.67% 93.67%
=======================================
Files 48 48
Lines 3401 3401
=======================================
Hits 3186 3186
Misses 215 215 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
CI rebuilt the development image and downloaded npm packages on every fresh runner, increasing traffic to Maven Central, Docker Hub, and npm. Reuse Docker build layers through the GitHub Actions cache and persist npm's content-addressed download cache while continuing to run
npm ciagainst the lockfile.Only successful pushes to main publish either cache. PR workflows restore caches without publishing entries. Cache saves run after the complete verification, E2E, coverage, and CRAP checks. Existing required checks and token permissions remain unchanged.
Validation: YAML parsing and
git diff --checkpassed; reviewed Compose image naming and cache restore/save consistency. GitHub CI validates the workflow execution. Docker layers reuse preloaded Maven artifacts whendeps.ednis unchanged; dependency changes still rebuild that layer, and standalone PostgreSQL pulls still use Docker Hub.