Use caching 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.
@@ -55,18 +55,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14.x"
-
- - name: Cache node modules
- uses: actions/cache@v2
- env:
- cache-name: cache-solidity-node-modules
- with:
- path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ cache: "npm"
+ cache-dependency-path: solidity/package-lock.json
- name: Install dependencies
run: npm ci
@@ -92,18 +82,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14.x"
-
- - name: Cache node modules
- uses: actions/cache@v2
- env:
- cache-name: cache-solidity-node-modules
- with:
- path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ cache: "npm"
+ cache-dependency-path: solidity/package-lock.json
- name: Install dependencies
run: npm ci
@@ -129,18 +109,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14.x"
-
- - name: Cache node modules
- uses: actions/cache@v2
- env:
- cache-name: cache-solidity-node-modules
- with:
- path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ cache: "npm"
+ cache-dependency-path: solidity/package-lock.json
- name: Install dependencies
run: npm ci
