-
Notifications
You must be signed in to change notification settings - Fork 5k
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: a new prep-deps workflow with caching #29979
base: self-hosted-benchmarks
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
c9f1e1e
to
6266945
Compare
0f6ed27
to
1283bfe
Compare
Builds ready [1283bfe]
Page Load Metrics (1641 ± 69 ms)
|
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.
Left one question & reviewed usage of caching from a security POV. No concerns from our end. I'll let the others chime in with regards to reviewing the functionality
uses: metamask/github-tools/.github/actions/setup-environment@main | ||
uses: metamask/github-tools/.github/actions/setup-environment@caching | ||
with: | ||
should-cache-restore: ${{ vars.USE_CACHING }} |
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.
What was the background behind choosing an env variable over harcoding?
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.
Pro: It's way fewer lines of code to do it this way. Setting a variable in main.yml
and passing it in to a bunch of workflows is harder, much less clean, and easier to accidentally mess up.
Con: You lose some control and repeatability of workflows.
I'm kind of in a divided mind myself.
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.
Ah I see what you mean. Other than slower performance due to the extra yarn install, are there any issues if the settings were accidentally set out out of sync?
I suspect most of the time we will want caching for these, and only in the odd case we may set a couple workflows to be false
. In which case ${{ vars.USE_CACHING }}
could be seen as being synonymous to true
(but with a var that can be flipped without going through the peer review flow).
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.
If prep-deps had USE_CACHING
set to false, and later steps had USE_CACHING
set to true, it would be a problem.
(Not blocking) Are there plans to version changes? While for now pointing directly to the main branch allows for immediate updates, it can result in challenges down the road if a breaking change is introduced. Could be handy to have things set up now to save time in the long run. |
Description
Major changes
prep-deps
runs first and caches the result, thenprep-build-test-webpack
makes an artifact, then the benchmarks run.prep-deps
setup-environment@caching
and deleting the independent "Checkout repository" stepmain.yml
for how to toggle it. We can discuss implementing this in a different way, but passing this variable through different workflows is actually kind of a pain (that's the first way I implemented it). Several of the jobs are 30-60 seconds faster when this is turned on.if: always()
statements make all independent tests run, even if one fails.test-lint-shellcheck, test-lint-changelog, test-lint-lockfile, test-deps-audit, test-yarn-dedupe, test-deps-depcheck, validate-lavamoat-allow-scripts
Prerequisites to merging this PR
caching
branch ofgithub-tools
: https://github.com/MetaMask/github-tools/blob/caching/.github/actions/setup-environment/action.ymlsetup-environment@caching
back tosetup-environment@main
Related issues
Split off from: #29955