-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
ci: try webpack cache #6269
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: try webpack cache #6269
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Any specific benefit to enable it? I can see the time spent on actions similar to before. |
I was also checking its benefits. It has actually reduced the webpack build time if you notice -
So it has reduced the time for the build site step. BeforeAfter |
Doesn't seem consistent, e.g., https://github.com/webpack/webpack.js.org/runs/7260630314?check_suite_focus=true without cache: While the latest action in this pull request with cache enabled: |
@chenxsan Can we merge this? |
@@ -56,7 +56,8 @@ | |||
"cypress:open": "cypress open", | |||
"cypress:run": "cypress run", | |||
"prettier": "prettier --write '**/*.{js,json,jsx,css,scss,md,mdx}'", | |||
"prepare": "husky install" | |||
"prepare": "husky install", | |||
"postinstall": "rimraf ./node_modules/.cache/webpack" |
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.
Any specific reason to clear the cache here?
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's officially recommended.
.github/workflows/deploy.yml
Outdated
key: build-${{ hashFiles('**/webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: |- | ||
build-${{ hashFiles('**/webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }} | ||
build-${{ hashFiles('**/webpack.*.js') }}- |
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 about those *.js
?
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.
This slipped my attention.
I suppose the cache got old. If you see the I triggered a re-run; this time, it used the latest cache from attempt 1 and the build was fast. And no new cache was stored in the |
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.
Awesome, let's get it merged and see how it goes later.
Enable webpack persistent cache on CI.
Comparision - #6269 (comment)