-
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
feat: move unit tests from Circleci to Github actions #25570
Merged
+49
−64
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d39b4a5
feat: run-unit-tests
itsyoboieltr f353ab5
fix: add corepack enable
itsyoboieltr a399875
fix: corepack enable
itsyoboieltr b678880
fix: remove unit tests from config
itsyoboieltr 9b8917e
fix: add pr action types
itsyoboieltr ce18831
fix: setup nodejs
itsyoboieltr 766a339
Merge branch 'develop' into move-unit-tests-to-github-actions
itsyoboieltr 335744f
feat: add codecov upload
itsyoboieltr 697f8ec
fix: test
itsyoboieltr 6b03bd3
fix: add token and fail on error
itsyoboieltr c082f24
Merge branch 'develop' into move-unit-tests-to-github-actions
itsyoboieltr 0cc1a57
Merge branch 'develop' into move-unit-tests-to-github-actions
itsyoboieltr 9711df5
Update config.yml
itsyoboieltr 042fe6f
feat: setup-environment reusable workflow
itsyoboieltr 4b3f0cd
fix: checkout
itsyoboieltr ce890f9
Update run-unit-tests.yml
itsyoboieltr 97eb64e
fix: composite action
itsyoboieltr 6814ed1
Update action.yml
itsyoboieltr c6a4933
Update action.yml
itsyoboieltr 6f6fbf6
Update config.yml
itsyoboieltr 32cdf03
Update action.yml
itsyoboieltr 62c2e93
Update action.yml
itsyoboieltr e63bc82
Update run-unit-tests.yml
itsyoboieltr 0438fc4
Merge branch 'develop' into move-unit-tests-to-github-actions
itsyoboieltr 15797c2
Update run-unit-tests.yml
itsyoboieltr d1be009
fix: add warning
itsyoboieltr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,16 +249,6 @@ workflows: | |
- /^Version-v(\d+)[.](\d+)[.](\d+)/ | ||
requires: | ||
- prep-build | ||
- test-unit-jest-main: | ||
requires: | ||
- prep-deps | ||
- test-unit-jest-development: | ||
requires: | ||
- prep-deps | ||
- upload-coverage: | ||
requires: | ||
- test-unit-jest-main | ||
- test-unit-jest-development | ||
- test-unit-global: | ||
requires: | ||
- prep-deps | ||
|
@@ -302,10 +292,7 @@ workflows: | |
- test-lint-shellcheck | ||
- test-lint-lockfile | ||
- test-lint-changelog | ||
- test-unit-jest-main | ||
- test-unit-jest-development | ||
- test-unit-global | ||
- upload-coverage | ||
- validate-source-maps | ||
- validate-source-maps-beta | ||
- validate-source-maps-flask | ||
|
@@ -1596,9 +1583,6 @@ jobs: | |
path: builds-test | ||
- store_artifacts: | ||
path: builds-test-flask | ||
- store_artifacts: | ||
path: coverage | ||
destination: coverage | ||
- store_artifacts: | ||
path: test-artifacts | ||
destination: test-artifacts | ||
|
@@ -1679,54 +1663,6 @@ jobs: | |
git config user.email [email protected] | ||
yarn ts-migration:dashboard:deploy | ||
|
||
test-unit-jest-development: | ||
executor: node-browsers-small | ||
steps: | ||
- run: *shallow-git-clone | ||
- run: sudo corepack enable | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
name: jest development unit tests | ||
command: yarn test:coverage:jest:dev | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- coverage | ||
- store_test_results: | ||
path: test/test-results/junit.xml | ||
|
||
test-unit-jest-main: | ||
executor: node-browsers-medium-plus | ||
parallelism: 8 | ||
steps: | ||
- run: *shallow-git-clone | ||
- run: sudo corepack enable | ||
- attach_workspace: | ||
at: . | ||
- run: | ||
name: test:coverage:jest | ||
command: yarn test:coverage:jest | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- coverage | ||
- store_test_results: | ||
path: test/test-results/junit.xml | ||
|
||
upload-coverage: | ||
executor: node-browsers-small | ||
steps: | ||
- run: *shallow-git-clone | ||
- run: sudo corepack enable | ||
- attach_workspace: | ||
at: . | ||
- codecov/upload | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- coverage | ||
|
||
test-unit-global: | ||
executor: node-browsers-small | ||
steps: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Setup environment' | ||
description: 'Setup environment' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- run: corepack enable | ||
shell: bash | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn --immutable | ||
shell: bash |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# WARNING! It is currently being investigated how to make this faster | ||
# DO NOT blindly copy this workflow, not noticing the slow down, | ||
# because suddenly our tests will take hours to pass CI. | ||
# Hopefully this comment here will help prevent that. | ||
# https://github.com/MetaMask/metamask-extension/issues/25680 | ||
|
||
name: Run unit tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened,reopened,synchronize] | ||
|
||
jobs: | ||
test-unit-jest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup environment | ||
uses: ./.github/actions/setup-environment | ||
|
||
- name: test:coverage:jest:dev | ||
run: yarn test:coverage:jest:dev | ||
|
||
- name: test:coverage:jest | ||
run: yarn test:coverage:jest | ||
|
||
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true |
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.
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.
We need to add a trigger for
develop
andmaster
here as well. These long-running branches will not have PRs associated with them, but it's very important that we know that tests are passing on them.