From 1c1c94b0615c5638842e2b1e5373de1d3bda730c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 22 Apr 2024 14:27:13 +0800 Subject: [PATCH] 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 --- .github/workflows/pull-compliance.yml | 12 +++++++++--- .github/workflows/pull-e2e-tests.yml | 4 +++- .github/workflows/release-nightly.yml | 4 +++- .github/workflows/release-tag-rc.yml | 4 +++- .github/workflows/release-tag-version.yml | 4 +++- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index c15983661b..c2ff5813b2 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -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 diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml index 3fca2bee80..28c3763df4 100644 --- a/.github/workflows/pull-e2e-tests.yml +++ b/.github/workflows/pull-e2e-tests.yml @@ -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 diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index d12b14572f..ad3213b712 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -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 diff --git a/.github/workflows/release-tag-rc.yml b/.github/workflows/release-tag-rc.yml index c6472073e4..034ef6913b 100644 --- a/.github/workflows/release-tag-rc.yml +++ b/.github/workflows/release-tag-rc.yml @@ -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 diff --git a/.github/workflows/release-tag-version.yml b/.github/workflows/release-tag-version.yml index a18af78a10..a5879d64f3 100644 --- a/.github/workflows/release-tag-version.yml +++ b/.github/workflows/release-tag-version.yml @@ -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