-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ci: add caching for dependency sources in CI workflow #7027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add caching for dependency sources in CI workflow #7027
Conversation
- Introduced a new job `cache-sources` in the GitHub Actions workflow to cache dependency sources, improving build efficiency. - Updated existing jobs to depend on `cache-sources` to utilize cached data when available. - Created a new file `cache-depends-sources.yml` to define the caching logic, including steps for checking and downloading sources. This change enhances the CI process by reducing redundant downloads and speeding up builds.
|
WalkthroughA new cache-depends-sources workflow was added to restore dependency sources (lookup-only) and run Sequence DiagramsequenceDiagram
participant GHA as GitHub Actions (build.yml)
participant CS as cache-sources Job
participant Cache as GitHub Cache
participant Repo as Repository (depends/)
participant Build as Build Jobs
GHA->>CS: start cache-sources (if skip == false)
activate CS
CS->>Repo: checkout repo (ref = PR/head)
CS->>Cache: restore lookup-only (key: hashFiles('depends/packages/*'))
activate Cache
alt cache hit
Cache-->>CS: cache hit (sources available)
else cache miss
Cache-->>CS: cache miss
CS->>Repo: make -C depends download
Repo-->>CS: sources downloaded
%% Note: lookup-only means no automatic save in this job
end
deactivate Cache
CS-->>GHA: complete
deactivate CS
GHA->>Build: require needs: [container, cache-sources]
Build->>GHA: run builds (may call build-depends.yml with container-path)
GHA-->>Build: continue build steps
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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. Comment |
UdjinM6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
latest working as expected: https://github.com/PastaPastaPasta/dash/actions/runs/19863026549 |
UdjinM6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 72eb33d
kwvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 72eb33d
6f7f799 fix: include depends/Makefile in sparse checkout (pasta) fd070cc fix: add depends/Makefile to PACKAGES hash (pasta) 36c143b fix: include ci-slim.Dockerfile (pasta) 5c10d85 ci: improve depends caching to be more compact, and bypass quickly if we have a cache hit (pasta) Pull request description: ## Issue being fixed or feature implemented depends on [another](#7027) ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 6f7f799 Tree-SHA512: b8018aa17d43dc426cba4403ef63800c3af49f2ced0fb0b5be89b0dfb153c337af93a00b55dd1be091dd40efa61513649b15fc2a7b506e0857456273dc4f3708
Issue being fixed or feature implemented
cache-sourcesin the GitHub Actions workflow to cache dependency sources, improving build efficiency.cache-sourcesto utilize cached data when available.cache-depends-sources.ymlto define the caching logic, including steps for checking and downloading sources.This is more important because in DashCoreAutoGuix, because things are less often merged into develop (they are merged into their own feature branch) the shared caches coming from develop become stale and get evicted. If we run it daily, it will ensure the shared cache (in develop) can be used by the runs in the feature branches. It may also be useful here, because currently each run tries to generate it's own cache, and they may race, and the sources used by the different runs are slightly different.
This is normally masked, because the final depends are cached well in this repo.
This change enhances the CI process by reducing redundant downloads and speeding up builds.
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
Go over all the following points, and put an
xin all the boxes that apply.