Skip to content

Commit 61f729a

Browse files
authored
chore: better cache on actions (#5525)
* chore: better cache on actions * chore: path seems to be a required field * chore: key is also required field
1 parent 1ef7ab1 commit 61f729a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/build-and-analysis.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ jobs:
5151
~/.npm
5252
.next/cache
5353
node_modules/.cache
54-
key: cache-${{ hashFiles('package-lock.json') }}
55-
restore-keys: cache-
54+
key: cache-${{ hashFiles('package-lock.json') }}-
55+
restore-keys: |
56+
cache-${{ hashFiles('package-lock.json') }}-
57+
cache-
5658
5759
- name: Set up Node.js
5860
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
@@ -86,7 +88,7 @@ jobs:
8688
~/.npm
8789
.next/cache
8890
node_modules/.cache
89-
key: cache-${{ hashFiles('package-lock.json') }}
91+
key: cache-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.next/cache/**') }}
9092

9193
analysis:
9294
name: Analysis
@@ -104,8 +106,10 @@ jobs:
104106
~/.npm
105107
.next/cache
106108
node_modules/.cache
107-
key: cache-${{ hashFiles('package-lock.json') }}
108-
restore-keys: cache-
109+
key: cache-${{ hashFiles('package-lock.json') }}-
110+
restore-keys: |
111+
cache-${{ hashFiles('package-lock.json') }}-
112+
cache-
109113
110114
- name: Download PR Bundle Analysis
111115
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a

.github/workflows/pull-request.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
.next/cache
3737
node_modules/.cache
3838
key: cache-${{ hashFiles('package-lock.json') }}-
39-
restore-keys: cache-
39+
restore-keys: |
40+
cache-${{ hashFiles('package-lock.json') }}-
41+
cache-
4042
4143
- name: Set up Node.js
4244
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
@@ -80,8 +82,10 @@ jobs:
8082
~/.npm
8183
.next/cache
8284
node_modules/.cache
83-
key: cache-${{ hashFiles('package-lock.json') }}
84-
restore-keys: cache-
85+
key: cache-${{ hashFiles('package-lock.json') }}-
86+
restore-keys: |
87+
cache-${{ hashFiles('package-lock.json') }}-
88+
cache-
8589
8690
- name: Set up Node.js
8791
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8

0 commit comments

Comments
 (0)