Skip to content

Commit a5a2844

Browse files
authored
ci: update cache key to exclude node_modules (#495)
1 parent 9241f93 commit a5a2844

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ runs:
1616
path: |
1717
**/node_modules
1818
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2020
restore-keys: |
21-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2222
${{ runner.os }}-yarn-
2323
2424
- name: Install dependencies

.github/workflows/build-templates.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ jobs:
121121
with:
122122
path: |
123123
${{ env.work_dir }}/**/node_modules
124-
${{ env.work_dir }}/**/yarn.lock
125-
key: ${{ runner.os }}-library-yarn-${{ hashFiles(format('{0}/**/package.json', env.work_dir)) }}
124+
${{ env.work_dir }}/yarn.lock
125+
key: ${{ runner.os }}-library-yarn-${{ hashFiles(format('{0}/**/package.json', env.work_dir), format('!{0}/node_modules/**', env.work_dir)) }}
126126
restore-keys: |
127127
${{ runner.os }}-library-yarn-
128128
@@ -159,7 +159,7 @@ jobs:
159159
with:
160160
path: |
161161
${{ env.work_dir }}/.turbo
162-
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/**/yarn.lock', env.work_dir)) }}
162+
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
163163
restore-keys: |
164164
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-
165165
@@ -241,7 +241,7 @@ jobs:
241241
path: |
242242
${{ env.work_dir }}/**/ios/Pods
243243
${{ env.work_dir }}/**/ios/Podfile.lock
244-
key: ${{ runner.os }}-library-cocoapods-${{ hashFiles(format('{0}/example/ios/Podfile', env.work_dir)) }}-${{ hashFiles(format('{0}/**/yarn.lock', env.work_dir)) }}
244+
key: ${{ runner.os }}-library-cocoapods-${{ hashFiles(format('{0}/example/ios/Podfile', env.work_dir)) }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
245245
restore-keys: |
246246
${{ runner.os }}-library-cocoapods-${{ hashFiles(format('{0}/example/ios/Podfile', env.work_dir)) }}-
247247
${{ runner.os }}-library-cocoapods-

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
with:
2424
path: |
2525
docs/.next/cache
26-
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
26+
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2727
restore-keys: |
28-
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}
28+
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}
2929
${{ runner.os }}-nextjs-
3030
3131
- name: Build docs

packages/create-react-native-library/templates/common/$.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ runs:
1616
path: |
1717
**/node_modules
1818
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2020
restore-keys: |
21-
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2222
${{ runner.os }}-yarn-
2323
2424
- name: Install dependencies

packages/create-react-native-library/templates/common/$.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
uses: actions/cache@v3
6464
with:
6565
path: ${{ env.TURBO_CACHE_DIR }}
66-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
66+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
6767
restore-keys: |
6868
${{ runner.os }}-turborepo-android-
6969
@@ -117,7 +117,7 @@ jobs:
117117
uses: actions/cache@v3
118118
with:
119119
path: ${{ env.TURBO_CACHE_DIR }}
120-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
120+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
121121
restore-keys: |
122122
${{ runner.os }}-turborepo-ios-
123123

0 commit comments

Comments
 (0)