-
Notifications
You must be signed in to change notification settings - Fork 0
Add cache for tblib compilation in release workflow #86
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -65,6 +65,26 @@ jobs: | |||||||
| with: | ||||||||
| driver: docker-container | ||||||||
|
|
||||||||
| - name: Cache tblib and cargo builds | ||||||||
| uses: actions/cache@v4 | ||||||||
| id: cache | ||||||||
| with: | ||||||||
| path: cache-mount | ||||||||
| key: buildkit-cache-${{ steps.meta.outputs.platform }}-${{ hashFiles('Dockerfile') }} | ||||||||
| restore-keys: | | ||||||||
| buildkit-cache-${{ steps.meta.outputs.platform }}- | ||||||||
|
|
||||||||
| - name: Inject tblib cache into Docker | ||||||||
| uses: reproducible-containers/buildkit-cache-dance@v3.2.0 | ||||||||
| with: | ||||||||
| cache-dir: cache-mount | ||||||||
| cache-map: | | ||||||||
| { | ||||||||
| "tblib-build": "/src/build", | ||||||||
| "cargo-cache": "/src/target" | ||||||||
| } | ||||||||
|
||||||||
| } | |
| } | |
| cache-key: ${{ steps.meta.outputs.platform }} |
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.
The cache scope is hardcoded to
tblib-linux/amd64but the pull-request workflow doesn't specify a platform for the build. This means:steps.meta.outputs.platformWhile this works for the current setup, it creates a maintenance burden. If someone later decides to test multi-platform builds in PRs or if the default runner platform changes, the hardcoded scope will cause cache misses or incorrect cache usage. Consider using a dynamic approach similar to the release workflow, or add a comment explaining why this is intentionally hardcoded to linux/amd64.