Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.

Commit 21b4aac

Browse files
Use caching mechanism built-in to the setup-node action
The `setup-node` action now supports caching. We can replace old caching mechanism with the mechanism offered by the action.
1 parent 072cd1f commit 21b4aac

3 files changed

Lines changed: 6 additions & 41 deletions

File tree

.github/workflows/initcontainer.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,8 @@ jobs:
3232
- uses: actions/setup-node@v2
3333
with:
3434
node-version: "14.x"
35-
36-
# In the future we could switch to using cache functionality built-in to
37-
# the `setup-node` action. Right now the functionality does not support
38-
# cases when package.json resides outside of the root directory, but there's
39-
# an open issue (https://github.com/actions/setup-node/issues/275) in the
40-
# works for that.
41-
- name: Cache node modules
42-
uses: actions/cache@v2
43-
env:
44-
cache-name: cache-solidity-node-modules
45-
with:
46-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
47-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
48-
restore-keys: |
49-
${{ runner.os }}-build-${{ env.cache-name }}-
50-
${{ runner.os }}-build-
51-
${{ runner.os }}-
35+
cache: "npm"
36+
cache-dependency-path: infrastructure/kube/templates/keep-ecdsa/initcontainer/provision-keep-ecdsa/package-lock.json
5237

5338
- name: Get upstream packages' versions
5439
uses: keep-network/ci/actions/upstream-builds-query@v1

.github/workflows/npm.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,10 @@ jobs:
2222
- uses: actions/setup-node@v2
2323
with:
2424
node-version: "14.x"
25+
cache: "npm"
26+
cache-dependency-path: solidity/package-lock.json
2527
registry-url: "https://registry.npmjs.org"
2628

27-
- name: Cache node modules
28-
uses: actions/cache@v1
29-
env:
30-
cache-name: cache-solidity-node-modules
31-
with:
32-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
33-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
34-
restore-keys: |
35-
${{ runner.os }}-build-${{ env.cache-name }}-
36-
${{ runner.os }}-build-
37-
${{ runner.os }}-
38-
3929
- name: Install dependencies
4030
run: npm ci
4131

.github/workflows/staker-rewards.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,8 @@ jobs:
4242
- uses: actions/setup-node@v2
4343
with:
4444
node-version: "14.x"
45-
46-
- name: Cache node modules
47-
uses: actions/cache@v2
48-
env:
49-
cache-name: cache-solidity-node-modules
50-
with:
51-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
52-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
53-
restore-keys: |
54-
${{ runner.os }}-build-${{ env.cache-name }}-
55-
${{ runner.os }}-build-
56-
${{ runner.os }}-
45+
cache: "npm"
46+
cache-dependency-path: staker-rewards/package-lock.json
5747

5848
- name: Install dependencies
5949
run: npm ci

0 commit comments

Comments
 (0)