Skip to content

Commit 2255638

Browse files
committed
build(actions): update actions, use actions/setup-node's builtin caching
1 parent 4521894 commit 2255638

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,11 @@ jobs:
1414
name: Build & Test
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-node@v3
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1919
with:
2020
node-version: 18
21-
- name: Cache node modules
22-
uses: actions/cache@v3
23-
env:
24-
cache-name: cache-node-modules
25-
with:
26-
path: ~/.npm
27-
# This uses the same name as the build-action so we can share the caches.
28-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
29-
restore-keys: |
30-
${{ runner.os }}-build-${{ env.cache-name }}-
31-
${{ runner.os }}-build-
32-
${{ runner.os }}-
21+
cache: npm
3322
- run: npm ci
3423
- name: test
3524
# Not using `npm test` since it rebuilds source which npm ci has already done

.github/workflows/release.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,16 @@ jobs:
1616
pull-requests: write
1717
steps:
1818
- name: Checkout Repo
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
2323

2424
- name: Setup Node.js 18.x
25-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2626
with:
2727
node-version: 18
28-
29-
- name: Cache node modules
30-
uses: actions/cache@v3
31-
env:
32-
cache-name: cache-node-modules
33-
with:
34-
path: ~/.npm
35-
# This uses the same name as the build-action so we can share the caches.
36-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
37-
restore-keys: |
38-
${{ runner.os }}-build-${{ env.cache-name }}-
39-
${{ runner.os }}-build-
40-
${{ runner.os }}-
28+
cache: npm
4129

4230
- name: Install Dependencies
4331
run: npm ci

0 commit comments

Comments
 (0)