From 35226ffd50b1924c2742c0c460cd0262710402b6 Mon Sep 17 00:00:00 2001 From: Lisa Yiran Zhu <34400837+lyzlisa@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:23:14 -0600 Subject: [PATCH 1/4] ci(opentelemetry-core): add npm cache in actions/setup-node@v3 --- .github/workflows/benchmark.yml | 3 +++ .github/workflows/docs.yaml | 3 +++ .github/workflows/lint.yml | 3 +++ .github/workflows/unit-test.yml | 15 +++++++++++++++ .github/workflows/w3c-integration-test.yml | 3 +++ 5 files changed, 27 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b847bc2d3e7..fb48fbd5a84 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -21,6 +21,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 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9c5e8037c7b..3c519e632e4 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 eac7627c9bb..53d8c79a01a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,6 +14,9 @@ jobs: steps: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: '16' - uses: actions/checkout@v4 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index ffebc82c29d..2aadf7dabd0 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -24,6 +24,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 @@ -59,6 +62,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 @@ -85,6 +91,9 @@ jobs: - uses: actions/setup-node@v4 with: + cache: 'npm' + cache-dependency-path: | + package-lock.json node-version: 16 - name: Bootstrap @@ -106,6 +115,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 @@ -133,6 +145,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 1df205b05d3..723314cb05f 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 🔧 From 6d4cd9eed55e9dcc486a913ea60f7355e889065e Mon Sep 17 00:00:00 2001 From: Lisa Yiran Zhu <34400837+lyzlisa@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:11:48 -0600 Subject: [PATCH 2/4] Move checkout step before setup-node --- .github/workflows/lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 53d8c79a01a..bdc446dce40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: cache: 'npm' @@ -19,8 +20,6 @@ jobs: package-lock.json node-version: '16' - - uses: actions/checkout@v4 - - name: Lint changelog file uses: avto-dev/markdown-lint@v1 with: From bd7d3cbd7474e11a2197f0e44e95cfe47ee85199 Mon Sep 17 00:00:00 2001 From: Lisa Yiran Zhu <34400837+lyzlisa@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:13:45 -0600 Subject: [PATCH 3/4] Add name to checkout step in lint.yml for consistency across all actions --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bdc446dce40..132fb5e6068 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: cache: 'npm' From 5da12f858008b2306f97ff3c5b88a21e9cb4265e Mon Sep 17 00:00:00 2001 From: Lisa Yiran Zhu <34400837+lyzlisa@users.noreply.github.com> Date: Fri, 10 Nov 2023 08:16:09 -0600 Subject: [PATCH 4/4] Bump actions/checkout to v4 in benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index fb48fbd5a84..5227ce2b491 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,7 +17,7 @@ jobs: NPM_CONFIG_UNSAFE_PERM: true steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: