Skip to content

Commit 664562a

Browse files
authored
Enable caching of npm install/npm ci for setup-node action (#1457)
The `setup-node` action now supports caching the results of `npm install`/`npm ci`: https://github.blog/changelog/2021-07-02-github-actions-setup-node-now-supports-dependency-caching/
1 parent f4057eb commit 664562a

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

Diff for: .github/workflows/check-dist.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Setup Node.js
18-
uses: actions/setup-node@v4
17+
- uses: actions/setup-node@v4
1918
with:
2019
node-version-file: .nvmrc
20+
cache: 'npm'
2121

22-
- name: Install npm dependencies
23-
run: npm clean-install
22+
- run: npm clean-install
2423

2524
- name: Rebuild the dist/ directory
2625
run: npm run package

Diff for: .github/workflows/dependabot-build.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ jobs:
3232
# Check out using a PAT so any pushed changes will trigger checkruns
3333
- uses: actions/checkout@v4
3434
with:
35-
ref: ${{ github.event.pull_request.head.ref }}
3635
token: ${{ secrets.DEPENDABOT_AUTOBUILD }}
3736

38-
- name: Setup Node.js
39-
uses: actions/setup-node@v4
37+
- uses: actions/setup-node@v4
4038
with:
4139
node-version-file: .nvmrc
40+
cache: 'npm'
4241

43-
- name: Install npm dependencies
44-
run: npm clean-install
42+
- run: npm clean-install
4543

4644
# If we're reacting to a Docker PR, we have on extra step to refresh and check in the container manifest,
4745
# this **must** happen before rebuilding dist/ so it uses the new version of the manifest

Diff for: .github/workflows/integration-test.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,16 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v4
2019
with:
2120
node-version-file: .nvmrc
21+
cache: 'npm'
2222

23-
- name: Install npm dependencies
24-
run: npm clean-install
23+
- run: npm clean-install
2524

2625
- name: Pre-fetch the pinned images
2726
run: npm run fetch-images -- bundler
2827

29-
- name: Run integration tests
30-
run: npm run test-integration
28+
- run: npm run test-integration
3129
env:
3230
GITHUB_TOKEN: ${{ github.token }}

Diff for: .github/workflows/test.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Setup Node.js
17-
uses: actions/setup-node@v4
16+
- uses: actions/setup-node@v4
1817
with:
1918
node-version-file: .nvmrc
19+
cache: 'npm'
2020

21-
- name: Install npm dependencies
22-
run: npm clean-install
21+
- run: npm clean-install
2322

24-
- name: Check formatting
25-
run: npm run format-check
23+
- run: npm run format-check
2624

27-
- name: Run linter
28-
run: npm run lint-check
25+
- run: npm run lint-check
2926

30-
- name: Run tests
31-
run: npm run test
27+
- run: npm run test

0 commit comments

Comments
 (0)