Enable npm cache on setup-node action (#30577) (#30590)

Backport #30577 

Enable npm dependency cache in
[setup-node](https://github.com/actions/setup-node). This should work
reliably and across branches as well.

---------

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Lunny Xiao 2024-04-22 14:27:13 +08:00 committed by GitHub
parent 0e20ccfe32
commit 1c1c94b061
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 7 deletions

View File

@ -58,9 +58,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend
- run: make lint-swagger
@ -127,9 +129,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend
- run: make lint-frontend
- run: make checks-frontend
@ -174,9 +178,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend
- run: make lint-md
- run: make docs

View File

@ -21,9 +21,11 @@ jobs:
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend frontend deps-backend
- run: npx playwright install --with-deps
- run: make test-e2e-sqlite

View File

@ -20,9 +20,11 @@ jobs:
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend deps-backend
# xgo build
- run: make release

View File

@ -21,9 +21,11 @@ jobs:
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend deps-backend
# xgo build
- run: make release

View File

@ -23,9 +23,11 @@ jobs:
with:
go-version: "~1.21"
check-latest: true
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- run: make deps-frontend deps-backend
# xgo build
- run: make release