From 9e9453649d6ef3b3c27629cd2fb442d7f41a030c Mon Sep 17 00:00:00 2001 From: lyzlisa <34400837+lyzlisa@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:30:50 -0500 Subject: [PATCH] ci: add npm cache in actions/setup-node (#4271) --- .github/workflows/benchmark.yml | 5 ++++- .github/workflows/docs.yaml | 3 +++ .github/workflows/lint.yml | 7 +++++-- .github/workflows/unit-test.yml | 15 +++++++++++++++ .github/workflows/w3c-integration-test.yml | 3 +++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b847bc2d3e..5227ce2b49 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,10 +17,13 @@ jobs: NPM_CONFIG_UNSAFE_PERM: true steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: ${{ matrix.node_version }} - run: npm install -g npm@latest diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9c5e8037c7..3c519e632e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,6 +13,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: '18' - name: Install and Build 🔧 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eac7627c9b..132fb5e606 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,12 +12,15 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: '16' - - uses: actions/checkout@v4 - - name: Lint changelog file uses: avto-dev/markdown-lint@v1 with: diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 9ad78a4458..281d1f4d29 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -25,6 +25,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: ${{ matrix.node_version }} - run: npm install -g npm@latest @@ -60,6 +63,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: '18' - run: npm install -g npm@latest @@ -86,6 +92,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: 16 - name: Bootstrap @@ -107,6 +116,9 @@ jobs: uses: actions/checkout@v4.0.0 - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: 16 - name: Bootstrap @@ -134,6 +146,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: ${{ matrix.node_version }} - name: Build diff --git a/.github/workflows/w3c-integration-test.yml b/.github/workflows/w3c-integration-test.yml index 1df205b05d..723314cb05 100644 --- a/.github/workflows/w3c-integration-test.yml +++ b/.github/workflows/w3c-integration-test.yml @@ -16,6 +16,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: '16' - name: Install and Bootstrap 🔧