Skip to content

Commit 8ca800c

Browse files
authored
Enable caching of npm install/npm ci for setup-node action (#618)
They now support 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 6787635 commit 8ca800c

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

.github/workflows/check-uncommitted.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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

2323
- name: Install NPM dependencies
2424
run: npm ci

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ 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 ci
23+
- run: npm ci
2524

26-
- name: Run linter
27-
run: npm run lint
25+
- run: npm run lint
2826

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

.github/workflows/dependabot-build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ jobs:
4141
# Check out using an app token so any pushed changes will trigger checkruns
4242
token: ${{ steps.generate_token.outputs.token }}
4343

44-
- name: Setup Node.js
45-
uses: actions/setup-node@v4
44+
- uses: actions/setup-node@v4
4645
with:
4746
node-version-file: .nvmrc
47+
cache: 'npm'
4848

49-
- name: Install NPM dependencies
50-
run: npm ci
49+
- run: npm ci
5150

5251
- name: Rebuild the dist/ directory
5352
run: npm run build

.github/workflows/release-bump-version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- uses: actions/setup-node@v4 # bin/bump-version needs npm
3737
with:
3838
node-version-file: .nvmrc
39+
cache: 'npm'
3940

4041
- name: Bump the version
4142
# Cron runs with no inputs, so version_type will default to 'minor'

0 commit comments

Comments
 (0)