Skip to content

Commit 90253c7

Browse files
authored
ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows (#419)
1 parent a8c52ab commit 90253c7

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ jobs:
1616
- uses: actions/setup-node@v2
1717
with:
1818
node-version: 14
19-
- uses: actions/cache@v2
20-
with:
21-
path: ~/.npm
22-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
23-
restore-keys: |
24-
${{ runner.os }}-node-
19+
cache: npm
2520
- run: npm ci
2621
- run: npm run build
2722
- run: npx semantic-release --debug

.github/workflows/test.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ jobs:
2424
uses: actions/setup-node@v2
2525
with:
2626
node-version: "${{ matrix.node_version }}"
27-
- uses: actions/cache@v2
28-
with:
29-
path: ~/.npm
30-
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}"
31-
restore-keys: |
32-
${{ runner.os }}-node-
27+
cache: npm
3328
- name: Install
3429
run: npm ci
3530
- name: Test

.github/workflows/update-prettier.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
- uses: actions/setup-node@v2
1212
with:
1313
version: 14
14+
cache: npm
1415
- run: npm ci
1516
- run: "npm run lint:fix"
1617
- uses: gr2m/[email protected]

.github/workflows/update.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- uses: actions/setup-node@v2
2323
with:
2424
node-version: 14
25+
cache: npm
2526

2627
# try checking out routes-update branch. Ignore error if it does not exist
2728
- run: git checkout routes-update || true

0 commit comments

Comments
 (0)