-
Notifications
You must be signed in to change notification settings - Fork 35
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
Enable babel-loader
cache, document webpack and babel-loader
cache
#990
Conversation
🦋 Changeset detectedLatest commit: de199a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
with: | ||
path: 'fixtures/*/node_modules/.cache/babel-loader' | ||
key: babel-loader-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }} | ||
restore-keys: babel-loader-${{ runner.os }}- |
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.
Just checking, is the trailing "-" correct?
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.
All these examples have a trailing hyphen, so I'd say yes.
It's probably not required, I think the restore key is just meant to be a non-unique prefix of the key
, so it would probably work without the -
too.
Co-authored-by: Michael Taranto <michaeltaranto@users.noreply.github.com>
From the changeset:
The emitted cache files take up a relatively small amount of space (10s of MBs, and the compress quite well), making it much more practical to cache on CI, relative to the webpack cache.
In a moderately-sized, internal monorepo, this cache dropped the
sku build
time in CI from an average of 4m 11s (across 5 builds) to an average of 3m 3s (across 5 builds). The cost of each cache file is roughly an extra 6s (saving and restoring the cache) and 8.3mb of storage.Caching
node_modules/.cache/babel-loader
across all of sku's fixtures decreased test time by ~20s in sku's CI.I've added docs for both this cache and the existing webpack cache in the
Extra features
docs. The docs are relatively high-level, and don't go into details on actually setting up a cache in CI.