Skip to content

Commit

Permalink
ci: Update cache action
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Jun 13, 2024
1 parent 2a71024 commit 8780a54
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y libnss3-tools
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- uses: actions/cache@v4
id: npm-cache
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
Expand Down

0 comments on commit 8780a54

Please # to comment.