react-spectrum
Cache react 17 install in CI
#1797
Merged

Cache react 17 install in CI #1797

devongovett merged 18 commits into main from cached-react-17-install
snowystinger
snowystinger4 years ago (edited 4 years ago)

Try to install 17 in such a way that we can cache it for tests and storybook
from ~15min down to ~9min!

cache behavior for yarn described in here https://circleci.com/docs/2.0/caching/#yarn-node
versioned caching here https://circleci.com/docs/2.0/caching/#clearing-cache

Closes

βœ… Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

πŸ“ Test Instructions:

🧒 Your Project:

snowystinger Try to install 17 in such a way that we can cache it for tests and st…
8d29d969
snowystinger snowystinger requested a review from dannify dannify 4 years ago
snowystinger snowystinger requested a review from devongovett devongovett 4 years ago
snowystinger fix config error
1e38b06d
snowystinger fix issue where i hadn't actually pulled the code into 17
91e4a82d
adobe-bot
adobe-bot4 years ago
snowystinger react 17 install shouldn't depend on react 16's install step if possible
255e9153
adobe-bot
adobe-bot4 years ago
adobe-bot
adobe-bot4 years ago
snowystinger use yarn partial lock matches for caches
97707039
snowystinger try to fix persist paths
caccf0be
snowystinger debugging
f5f66815
snowystinger possibly dist didn't exist, try manually adding it
4e87b213
snowystinger rename test-17 to fit the rest of the names
6fd09c5d
snowystinger not sure why we'd need to do this now, * should work, but it's not fi…
fb9fa52d
snowystinger a different pattern variation
368b60cd
snowystinger follow docs suggestion to include tmp in root
996a92d1
snowystinger may have pushed some bad cache names, be very explicit about them
6b1099fb
adobe-bot
adobe-bot4 years ago
snowystinger try again to skip building icons for comments job
983aa474
adobe-bot
adobe-bot4 years ago
snowystinger debug branch name of cache
a581c520
adobe-bot
adobe-bot4 years ago
snowystinger Add versioning to cache so I don't run into the issue i did earlier
c245c7c7
adobe-bot
adobe-bot4 years ago
adobe-bot
adobe-bot4 years ago
snowystinger used invalid config but wasn't getting that as a message
c450f0a3
adobe-bot
adobe-bot4 years ago
devongovett
devongovett commented on 2021-04-19
.circleci/config.yml
16 keys:
17 - rsp-yarn-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
18 - rsp-yarn-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-
19
- rsp-yarn-{{ .Environment.CACHE_VERSION }}-
devongovett4 years ago

Does this need to restore the react-spectrum- cache as well, which is saved below?

snowystinger4 years ago (edited 4 years ago)

this will restore ~/.cache/yarn

react-spectrum- key will restore source code, which may be different than what was received from checkout
seemed safer to use the checkout code and rebuild what we need

this may be a further optimization down the line if builds start getting longer again, but we'd need to be careful with it

the only reason the key react-spectrum- exists is because it's the code checked out with postinstall run, so we can now run lint/tests/storybook etc, those steps no longer checkout the code, they rely on this cache. we could have persisted it to the workspace as well, but I didn't look into the performance differences there yet, future possible optimization

devongovett4 years ago

hmm so why to we write to the react-spectrum cache key then if we don't use it?

snowystinger4 years ago

you'll also note that there are both a react-spectrum- and react-spectrum17 cache key, so those downstream jobs can get the code all setup with the right react version

snowystinger Merge branch 'main' into cached-react-17-install
9f3d944f
adobe-bot
adobe-bot4 years ago
devongovett
devongovett approved these changes on 2021-04-19
devongovett devongovett merged 5907fb71 into main 4 years ago
devongovett devongovett deleted the cached-react-17-install branch 4 years ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone