From 18cec335624cee93cbde4add7e27944124c511c9 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:25:52 +0100 Subject: [PATCH 1/8] Use actions/setup-node cache --- .github/workflows/build-test.yml | 33 ++++---------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b92f505..129c80b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,9 +9,6 @@ jobs: prepare: name: Prepare runs-on: ubuntu-latest - outputs: - YARN_CACHE_DIR: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - YARN_VERSION: ${{ steps.yarn-version.outputs.YARN_VERSION }} strategy: matrix: node-version: [14.x, 16.x, 18.x, 19.x] @@ -21,17 +18,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Get Yarn cache directory - run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" - id: yarn-cache-dir - - name: Get Yarn version - run: echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT" - id: yarn-version - - name: Cache Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} + cache: 'yarn2' - name: Install Yarn dependencies run: yarn --immutable @@ -49,11 +36,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} + cache: 'yarn2' - run: yarn --immutable - run: yarn build - name: Require clean working directory @@ -78,11 +61,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} + cache: 'yarn2' - run: yarn --immutable - run: yarn lint - name: Validate RC changelog @@ -113,11 +92,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: Restore Yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }} + cache: 'yarn2' - run: yarn --immutable - run: yarn test - name: Require clean working directory From 366e9be17eed817cf68b63103b64db4cf92a7ef3 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:30:08 +0100 Subject: [PATCH 2/8] Set actions/setup-node version to 3.4.1 --- .github/workflows/build-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 129c80b..fb7c890 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v3.4.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v3.4.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -58,7 +58,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v3.4.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -89,7 +89,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v3.4.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' From d38a1c07cb813d221f0db61f3d2c248f2d9ee881 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:31:55 +0100 Subject: [PATCH 3/8] Set actions/setup-node version to 3.5.1 --- .github/workflows/build-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index fb7c890..9c690f4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v3.5.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v3.5.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -58,7 +58,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v3.5.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -89,7 +89,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v3.5.1 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' From b6acdd20bb47eb7bbf91b7502d24c3003c3594c8 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:34:45 +0100 Subject: [PATCH 4/8] Revert version change --- .github/workflows/build-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9c690f4..129c80b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -58,7 +58,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' @@ -89,7 +89,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.5.1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'yarn2' From 4854f7dd967c2de36757047233eeed6358b7a1a7 Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:35:10 +0100 Subject: [PATCH 5/8] Set cache to 'yarn' --- .github/workflows/build-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 129c80b..eb1d5ea 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,7 +18,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'yarn2' + cache: 'yarn' - name: Install Yarn dependencies run: yarn --immutable @@ -36,7 +36,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'yarn2' + cache: 'yarn' - run: yarn --immutable - run: yarn build - name: Require clean working directory @@ -61,7 +61,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'yarn2' + cache: 'yarn' - run: yarn --immutable - run: yarn lint - name: Validate RC changelog @@ -92,7 +92,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'yarn2' + cache: 'yarn' - run: yarn --immutable - run: yarn test - name: Require clean working directory From 5714747b2ae4ea26e9fe661a4300855d9eadef9f Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 16:37:53 +0100 Subject: [PATCH 6/8] Run prepare for a single Node version --- .github/workflows/build-test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index eb1d5ea..73bfe6b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -9,15 +9,12 @@ jobs: prepare: name: Prepare runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x, 16.x, 18.x, 19.x] steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version-file: '.nvmrc' cache: 'yarn' - name: Install Yarn dependencies run: yarn --immutable From c1d9e55e178d06e9be5fac3a69e2b027da7e5afa Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 22:32:43 +0100 Subject: [PATCH 7/8] Add --immutable-cache to build, lint, test jobs --- .github/workflows/build-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 73bfe6b..8c7b431 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -34,7 +34,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'yarn' - - run: yarn --immutable + - run: yarn --immutable --immutable-cache - run: yarn build - name: Require clean working directory shell: bash @@ -59,7 +59,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'yarn' - - run: yarn --immutable + - run: yarn --immutable --immutable-cache - run: yarn lint - name: Validate RC changelog if: ${{ startsWith(github.head_ref, 'release/') }} @@ -90,7 +90,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'yarn' - - run: yarn --immutable + - run: yarn --immutable --immutable-cache - run: yarn test - name: Require clean working directory shell: bash From fe4232234dba88f69d347fcc64bc42c336c5781a Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 10 Nov 2022 22:34:42 +0100 Subject: [PATCH 8/8] Replace one more use of cache --- .github/workflows/publish-docs.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 5fc4c19..7818654 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -19,21 +19,11 @@ jobs: run: exit 1 - name: Checkout the repository uses: actions/checkout@v3 - - name: Setup Node.js + - name: Use Node.js uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - - name: Get Yarn cache directory - run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" - id: yarn-cache-dir - - name: Get Yarn version - run: echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT" - id: yarn-version - - name: Cache yarn dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} - key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }} + cache: 'yarn' - name: Install npm dependencies run: yarn --immutable - name: Run build script