Skip to content

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

Merged
merged 10 commits into from
Jul 21, 2022
Merged

ci: try webpack cache #6269

merged 10 commits into from
Jul 21, 2022

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Jul 13, 2022

Enable webpack persistent cache on CI.

Comparision - #6269 (comment)

@vercel
Copy link

vercel bot commented Jul 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
webpack-js-org ✅ Ready (Inspect) Visit Preview Jul 20, 2022 at 5:22AM (UTC)

@chenxsan
Copy link
Member

Any specific benefit to enable it? I can see the time spent on actions similar to before.

@snitin315
Copy link
Member Author

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.

Before

Screenshot 2022-07-15 at 8 59 43 AM

After

Screenshot 2022-07-15 at 9 00 01 AM

@chenxsan
Copy link
Member

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.

Before

Screenshot 2022-07-15 at 8 59 43 AM

After

Screenshot 2022-07-15 at 9 00 01 AM

Doesn't seem consistent, e.g., https://github.com/webpack/webpack.js.org/runs/7260630314?check_suite_focus=true without cache:

CleanShot 2022-07-15 at 11 51 03@2x

While the latest action in this pull request with cache enabled:

CleanShot 2022-07-15 at 11 52 01@2x

@snitin315
Copy link
Member Author

Yeah, this inconsistency this actually because of the other scripts we run before building (src/utilities/fetch-package-repos.mjs). If you notice the webpack build time only, it is reduced.

Screenshot 2022-07-15 at 4 00 43 PM

Screenshot 2022-07-15 at 4 00 56 PM

@snitin315 snitin315 marked this pull request as ready for review July 16, 2022 02:50
@snitin315
Copy link
Member Author

@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"
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 31 to 34
key: build-${{ hashFiles('**/webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |-
build-${{ hashFiles('**/webpack.*.js') }}-${{ hashFiles('**/yarn.lock') }}
build-${{ hashFiles('**/webpack.*.js') }}-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about those *.js?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This slipped my attention.

@chenxsan
Copy link
Member

Interesting, it's no longer faster than before now.

Both are from this pull request's action logs:

CleanShot 2022-07-20 at 19 57 23@2x

CleanShot 2022-07-20 at 20 00 15@2x

@snitin315
Copy link
Member Author

I suppose the cache got old. If you see the Post enable webpack persistent cache step in Attempt 1 you will see that the new cache was stored.

Screenshot 2022-07-20 at 6 35 32 PM

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 Post enable webpack persistent cache step.

Screenshot 2022-07-20 at 6 38 50 PM

Screenshot 2022-07-20 at 6 38 59 PM

Screenshot 2022-07-20 at 6 34 54 PM

Copy link
Member

@chenxsan chenxsan left a 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.

@chenxsan chenxsan merged commit 376a3e9 into master Jul 21, 2022
@chenxsan chenxsan deleted the try-webpack-cache branch July 21, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants