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
Speedup e2e test on github #14627
Speedup e2e test on github #14627
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 |
---|---|---|
|
@@ -44,13 +44,36 @@ jobs: | |
- react-native | ||
- prettier | ||
steps: | ||
- name: Get yarn1 cache directory path | ||
id: yarn1-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js latest | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
cache: "yarn" | ||
- name: Get yarn3 cache directory path | ||
id: yarn3-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
- name: Use yarn1 cache | ||
uses: actions/cache@v3 | ||
id: yarn1-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn1-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}- | ||
- name: Use yarn3 cache | ||
uses: actions/cache@v3 | ||
id: yarn3-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn3-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn3-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn3-e2e-${{ matrix.project }}- | ||
- name: Clean babel cache | ||
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. Q: why do we need to clean the cache? 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. Because I found that the latest compiled babel will not be used, but the cache will be used. The babel package changes between each different CI test. |
||
run: | | ||
rm -rf ${{ steps.yarn1-cache-dir-path.outputs.dir }}/*babel* | ||
rm -rf ${{ steps.yarn3-cache-dir-path.outputs.dir }}/*babel* | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: verdaccio-workspace | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,15 +58,17 @@ if [ "$BABEL_8_BREAKING" = true ] ; then | |
" | ||
fi | ||
|
||
sed -i 's/"skipLibCheck": false,/"skipLibCheck": true,/g' tsconfig.json # Speedup | ||
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. When we'll start publishing our type definitions we will need to re-enable this. However, they can safely be skipped for now. 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. Yes, the process was too slow and took about 8 minutes. |
||
|
||
yarn build | ||
|
||
# The full test suite takes about 20mins on CircleCI. We run only a few of them | ||
# to speed it up. | ||
# The goals of this e2e test are: | ||
# 1) Check that the typescript compilation isn't completely broken | ||
# 2) Make sure that we don't accidentally break jest's usage of the Babel API | ||
CI=true yarn test-ci-partial packages | ||
CI=true yarn test-ci-partial e2e/__tests__/babel | ||
CI=true yarn test-ci-partial e2e/__tests__/transform | ||
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs packages | ||
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs e2e/__tests__/babel | ||
CI=true yarn jest --color --maxWorkers=2 --config jest.config.mjs e2e/__tests__/transform | ||
|
||
cleanup |
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.
Q: Can we use
cache: yarn
in setup-node@v3?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.
It used to be like this, but that would use the same cache as
ci
, with only babel's dependencies, not what the E2E project needs.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.
Maybe we can try
cache-dependency-path
?https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data
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.
#14627 (comment)
As mentioned here, that's certainly good, but requires us to split the test script file and put the cache action after pulling the third-party repository.