Circle CI: do not share .git cache across different operating systems (#34885)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34885

We use workflows extensively in Circle CI, so caching a git checkout should help speed up tests when downstream jobs need to checkout the repository. In the current configuration, the Windows job is most likely to run and write to the .git cache first, which results in permission issues when the .git cache is loaded onto macOS or linux hosts.

By splitting the cache by architecture, we may lose on some reusability across jobs with distinct architectures, but it ensures we avoid cross-platform permission issues.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D40150781

fbshipit-source-id: 4a4b2a4da5e20f754b72db0c9852c7c1616b610c
This commit is contained in:
Héctor Ramos 2022-10-07 10:21:25 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 35556dba60
Коммит af4e061523
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -133,12 +133,12 @@ commands:
steps:
- restore_cache:
keys:
- << parameters.checkout_base_cache_key >>-{{ .Branch }}-{{ .Revision }}
- << parameters.checkout_base_cache_key >>-{{ .Branch }}-
- << parameters.checkout_base_cache_key >>
- << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
- << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-
- << parameters.checkout_base_cache_key >>-{{ arch }}-
- checkout
- save_cache:
key: << parameters.checkout_base_cache_key >>-{{ .Branch }}-{{ .Revision }}
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
paths:
- ".git"