Skip to content

Commit d51106c

Browse files
committed
Build: Simplify caching in CI
Our setup is pretty standard, so manual configuration of `actions/cache` is an overkill. Relying on built-in `actions/node` caching will also resolve differences between caching configurations for macOS/Linux vs. Windows.
1 parent efcf81a commit d51106c

File tree

4 files changed

+12
-48
lines changed

4 files changed

+12
-48
lines changed

.github/workflows/browser-tests.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,8 @@ jobs:
3737
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3838
with:
3939
node-version: ${{ env.NODE_VERSION }}
40-
41-
- name: Cache
42-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
43-
with:
44-
path: ~/.npm
45-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
46-
restore-keys: |
47-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
40+
cache: npm
41+
cache-dependency-path: '**/package-lock.json'
4842

4943
- name: Set download URL for Firefox ESR (old)
5044
run: |
@@ -92,14 +86,8 @@ jobs:
9286
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
9387
with:
9488
node-version: ${{ env.NODE_VERSION }}
95-
96-
- name: Cache
97-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
98-
with:
99-
path: ~/.npm
100-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
101-
restore-keys: |
102-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
89+
cache: npm
90+
cache-dependency-path: '**/package-lock.json'
10391

10492
- name: Install dependencies
10593
run: npm install
@@ -121,14 +109,8 @@ jobs:
121109
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
122110
with:
123111
node-version: ${{ env.NODE_VERSION }}
124-
125-
- name: Cache
126-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
127-
with:
128-
path: ~/.npm
129-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
130-
restore-keys: |
131-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
112+
cache: npm
113+
cache-dependency-path: '**/package-lock.json'
132114

133115
- name: Install dependencies
134116
run: npm install

.github/workflows/browserstack.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,8 @@ jobs:
5151
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5252
with:
5353
node-version: ${{ env.NODE_VERSION }}
54-
55-
- name: Cache
56-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
57-
with:
58-
path: ~/.npm
59-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
60-
restore-keys: |
61-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
54+
cache: npm
55+
cache-dependency-path: '**/package-lock.json'
6256

6357
- name: Install dependencies
6458
run: npm install

.github/workflows/filestash.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ jobs:
2323
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2424
with:
2525
node-version: ${{ env.NODE_VERSION }}
26-
27-
- name: Cache
28-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
29-
with:
30-
path: ~/.npm
31-
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
26+
cache: npm
27+
cache-dependency-path: '**/package-lock.json'
3428

3529
- name: Install dependencies
3630
run: npm install

.github/workflows/node.js.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,8 @@ jobs:
2727
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2828
with:
2929
node-version: ${{ matrix.NODE_VERSION }}
30-
31-
- name: Cache
32-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
33-
with:
34-
path: ~/.npm
35-
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
36-
restore-keys: |
37-
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-
30+
cache: npm
31+
cache-dependency-path: '**/package-lock.json'
3832

3933
- name: Install dependencies
4034
run: npm install

0 commit comments

Comments
 (0)