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
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52137/ |
We can only see the effect when we merge this PR or re run it. |
Thanks! CI run with these updates: https://github.com/liuxingbaoyu/babel/actions/runs/2419282915 |
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 comment
The 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 comment
The 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.
@@ -58,6 +58,8 @@ 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the process was too slow and took about 8 minutes.
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Use Node.js latest | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "*" | ||
- name: Get yarn3 cache directory path |
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.
the best way is to use the hash of the target project's lock file as the key
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.
In fact, the best way is to use the hash of the target project's lock file as the key, but that requires a lot of changes, so I chose this, and it works well in most cases. |
🥳🥳🥳🥳🥳 |
https://github.com/babel/babel/runs/6695976283?check_suite_focus=true#step:10:987 In addition, this exception appeared again. |
Fixes #1, Fixes #2
Speed up all e2e tests on github.
The jest is the most obvious, going from 16-18 minutes to 5-7 minutes.
The total time went from 20-25 minutes to 12 minutes.
skipLibCheck
in jest.We can produce less CO2!😄