ci: reuse cached build for constants check via artifact#6
Open
huth-stacks wants to merge 1 commit into
Open
Conversation
Instead of compiling stacks-inspect from scratch (4+ minutes), the nextest-archive job now generates the constants JSON and uploads it as an artifact. The constants-check job downloads and diffs it, reducing the check from 4 minutes to ~10 seconds. Also adds create-cache to constants-check's needs in ci.yml so the artifact is available before the download step runs.
203464a to
713d343
Compare
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.
What
Generate the constants JSON during the nextest-archive build (where stacks-inspect is already compiled) and pass it to the constants-check job via artifact, eliminating a redundant 4-minute compilation.
Why
constants-check.ymlrunscargo run --bin stacks-inspect -- dump-constswhich compilesstacks-inspectand all its dependencies from scratch (4m10s). The nextest-archive job increate-cache.ymlalready compiles the entire workspace. By runningdump-conststhere and uploading the JSON as an artifact, we eliminate the redundant compilation entirely.The Change
File 1:
.github/workflows/create-cache.yml(+11 lines)Add two steps at the end of the nextest-archive job:
cargo run --bin stacks-inspect -- dump-consts > constants.jsonactions/upload-artifact@v4with nameconstants-dump, 1-day retentionFile 2:
.github/workflows/constants-check.yml(-16/+4 lines)Replace Rust toolchain setup +
cargo runwith:actions/download-artifact@v4with nameconstants-dumpdiff constants.json ./sample/expected_consts.json~15 lines changed across 2 files.
How to Verify
Metrics to Track
Security Checklist
actions/upload-artifact@v4andactions/download-artifact@v4(already used elsewhere in CI)Part of CI Optimization Series
PR 6 of 7. Most complex change in the series. Expected impact: ~4 min off total pipeline.