-
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?
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 |
---|---|---|
|
@@ -42,7 +42,9 @@ jobs: | |
|
||
- name: Setup environment | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
uses: metamask/github-tools/.github/actions/setup-environment@main | ||
uses: metamask/github-tools/.github/actions/setup-environment@caching | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like setup environment has too many arguments and it's doing too much. I wonder if this could be separated to multiple smaller workflows? |
||
with: | ||
no-cache-for-release: 'true' # Turn off yarn cache as well | ||
|
||
- name: Run beta build | ||
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,8 @@ jobs: | |
check-attributions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup environment | ||
uses: metamask/github-tools/.github/actions/setup-environment@main | ||
uses: metamask/github-tools/.github/actions/setup-environment@caching | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should change from |
||
|
||
- name: Check attributions changes | ||
run: yarn attributions:check |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,62 +15,52 @@ on: | |
merge_group: | ||
|
||
jobs: | ||
prep-deps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running Also keep in mind that we need to migrate 40 more workflows. More context here: https://consensys.slack.com/archives/C087GPTR5HQ/p1738658608653149 |
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup environment | ||
uses: metamask/github-tools/.github/actions/setup-environment@caching | ||
with: | ||
should-cache-restore: 'false' | ||
should-cache-save: ${{ vars.USE_CACHING }} | ||
# -- If you're a repo admin, you can change vars.USE_CACHING at: | ||
# https://github.com/MetaMask/metamask-extension/settings/variables/actions | ||
# -- If you're just a contributor, you can change vars.USE_CACHING by following this documentation: | ||
# https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable | ||
|
||
lint-workflows: | ||
name: Lint workflows | ||
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@benchmarks | ||
|
||
test-lint-shellcheck: | ||
name: Test lint shellcheck | ||
uses: ./.github/workflows/test-lint-shellcheck.yml | ||
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@caching | ||
|
||
test-lint: | ||
name: Test lint | ||
needs: prep-deps | ||
uses: ./.github/workflows/test-lint.yml | ||
|
||
test-lint-changelog: | ||
name: Test lint changelog | ||
uses: ./.github/workflows/test-lint-changelog.yml | ||
|
||
test-lint-lockfile: | ||
name: Test lint lockfile | ||
uses: ./.github/workflows/test-lint-lockfile.yml | ||
|
||
test-deps-audit: | ||
name: Test deps audit | ||
uses: ./.github/workflows/test-deps-audit.yml | ||
|
||
test-yarn-dedupe: | ||
name: Test yarn dedupe | ||
uses: ./.github/workflows/test-yarn-dedupe.yml | ||
|
||
test-deps-depcheck: | ||
name: Test deps depcheck | ||
uses: ./.github/workflows/test-deps-depcheck.yml | ||
test-short-suite: | ||
needs: prep-deps | ||
uses: ./.github/workflows/test-short-suite.yml | ||
|
||
test-storybook: | ||
name: Test storybook | ||
needs: prep-deps | ||
uses: ./.github/workflows/test-storybook.yml | ||
|
||
validate-lavamoat-allow-scripts: | ||
name: Validate lavamoat allow scripts | ||
uses: ./.github/workflows/validate-lavamoat-allow-scripts.yml | ||
|
||
validate-lavamoat-policy-build: | ||
name: Validate lavamoat policy build | ||
needs: prep-deps | ||
uses: ./.github/workflows/validate-lavamoat-policy-build.yml | ||
|
||
validate-lavamoat-policy-webapp: | ||
name: Validate lavamoat policy webapp | ||
needs: prep-deps | ||
uses: ./.github/workflows/validate-lavamoat-policy-webapp.yml | ||
|
||
prep-build-test-webpack: | ||
needs: prep-deps | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup environment | ||
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 commentThe 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 commentThe 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 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If prep-deps had There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose another option is to just set all of these to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably also hard-code |
||
|
||
- run: yarn webpack --test --no-lavamoat --no-cache --browser=chrome --lockdown --sentry --snow --env production | ||
env: | ||
|
@@ -85,6 +75,7 @@ jobs: | |
|
||
run-tests: | ||
name: Run tests | ||
needs: prep-deps | ||
uses: ./.github/workflows/run-tests.yml | ||
|
||
run-pageload-benchmark: | ||
|
@@ -150,21 +141,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: | ||
- lint-workflows | ||
- test-lint-shellcheck | ||
- test-lint | ||
- test-lint-changelog | ||
- test-lint-lockfile | ||
- test-yarn-dedupe | ||
- test-deps-depcheck | ||
- test-storybook | ||
- validate-lavamoat-allow-scripts | ||
- test-short-suite | ||
- validate-lavamoat-policy-build | ||
- validate-lavamoat-policy-webapp | ||
- run-tests | ||
# - run-pageload-benchmark # Will enable this as a required job in a later PR | ||
# - run-user-actions-benchmark # Will enable this as a required job in a later PR | ||
- wait-for-circleci-workflow-status | ||
- build-storybook | ||
- build-beta | ||
outputs: | ||
PASSED: ${{ steps.set-output.outputs.PASSED }} | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
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.
I would not merge the
Checkout repository
andSetup environment
steps together. What if there is some occasion where you want only one? Feels like this step is doing too much at once