From 00d937add1ef34d5016601da733d1f0ba349b516 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Wed, 15 Nov 2023 15:26:13 +0000 Subject: [PATCH 1/9] ci: bump node from v16 to v20 LTS --- .github/workflows/test.yml | 4 ++-- .nvmrc | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12b3cb5edb..266e728721 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v4 - name: Restore node_modules @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v4 - name: Restore node_modules diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..805b5a4e00 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.9.0 From ee6b8b3f1ecb19e5616606d98a40e3a3d0f62c51 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Wed, 15 Nov 2023 15:39:12 +0000 Subject: [PATCH 2/9] Update .nvmrc Co-authored-by: Peter Makowski --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 805b5a4e00..9a2a0e219c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.9.0 +v20 From 25a6af60ac032661cf0f5cd0c2326666c4585c93 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Wed, 15 Nov 2023 15:57:18 +0000 Subject: [PATCH 3/9] Add step to read node version from nvmrc in test.yml --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 266e728721..bc79a945a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: - main pull_request: types: [opened, synchronize, reopened] +- name: Read .nvmrc + run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV jobs: lint: name: Lint @@ -20,10 +22,10 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NVMRC }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NVMRC }} - name: Install if: steps.yarn-cache.outputs.cache-hit != 'true' run: CYPRESS_INSTALL_BINARY=0 yarn install @@ -43,10 +45,10 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ env.NVMRC }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NVMRC }} - name: Install if: steps.yarn-cache.outputs.cache-hit != 'true' run: CYPRESS_INSTALL_BINARY=0 yarn install From b62f92a342e0087744afea2638fb22b4b484dd71 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Wed, 15 Nov 2023 16:02:03 +0000 Subject: [PATCH 4/9] fix my yml syntax - attempt 1 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc79a945a9..fc46aad824 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,9 @@ on: - main pull_request: types: [opened, synchronize, reopened] -- name: Read .nvmrc - run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV jobs: + - name: Read .nvmrc + run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV lint: name: Lint runs-on: ubuntu-22.04 From c6cbdf2e082fdf3fabe4f85138a59f05948c5ca5 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Thu, 16 Nov 2023 09:10:46 +0000 Subject: [PATCH 5/9] fix my yml syntax - attempt 2 --- .github/workflows/test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc46aad824..554f33c397 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,10 +6,15 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - - name: Read .nvmrc - run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV + read-node-version: + name: "Read NodeJS version" + runs-on: ubuntu-22.04 + steps: + - name: "Read .nvmrc" + run: "echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV" lint: name: Lint + needs: read-node-version runs-on: ubuntu-22.04 strategy: matrix: @@ -33,6 +38,7 @@ jobs: test: name: Test + needs: read-node-version runs-on: ubuntu-22.04 strategy: matrix: From d26d5385b810acce7ad42dd70bf7a354d2e8cc72 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Thu, 16 Nov 2023 09:57:42 +0000 Subject: [PATCH 6/9] remove strategey + matrix --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 554f33c397..eaca1610b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,9 +16,6 @@ jobs: name: Lint needs: read-node-version runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: [20.x] steps: - uses: actions/checkout@v4 - name: Restore node_modules @@ -40,9 +37,6 @@ jobs: name: Test needs: read-node-version runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: [20.x] steps: - uses: actions/checkout@v4 - name: Restore node_modules From faec9086c43d1f0b2ece7bde20a127ab05173e50 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Thu, 16 Nov 2023 10:02:56 +0000 Subject: [PATCH 7/9] check out the branch *before* reading NVMRC --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eaca1610b4..feceb80411 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ jobs: name: "Read NodeJS version" runs-on: ubuntu-22.04 steps: + - uses: actions/checkout@v4 - name: "Read .nvmrc" run: "echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV" lint: From 178948df08708d1faf0d565c1063563abb97a504 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Thu, 16 Nov 2023 11:04:42 +0000 Subject: [PATCH 8/9] Use node-version-file instead of reading and adding to env --- .github/workflows/test.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index feceb80411..93ec67967f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,16 +6,8 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - read-node-version: - name: "Read NodeJS version" - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: "Read .nvmrc" - run: "echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV" lint: name: Lint - needs: read-node-version runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -25,10 +17,10 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Use Node.js ${{ env.NVMRC }} + - name: Use Node.js from .nvrmc uses: actions/setup-node@v3 with: - node-version: ${{ env.NVMRC }} + node-version-file: '.nvrmc' - name: Install if: steps.yarn-cache.outputs.cache-hit != 'true' run: CYPRESS_INSTALL_BINARY=0 yarn install @@ -36,7 +28,6 @@ jobs: test: name: Test - needs: read-node-version runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -46,10 +37,10 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Use Node.js ${{ env.NVMRC }} + - name: Use Node.js from .nvmrc uses: actions/setup-node@v3 with: - node-version: ${{ env.NVMRC }} + node-version-file: '.nvmrc' - name: Install if: steps.yarn-cache.outputs.cache-hit != 'true' run: CYPRESS_INSTALL_BINARY=0 yarn install From ac6e7ddd2fc2613bb59aab0ffc1fd57de2d2b7e5 Mon Sep 17 00:00:00 2001 From: Nick De Villiers Date: Thu, 16 Nov 2023 11:11:52 +0000 Subject: [PATCH 9/9] it's nvmrc, not nvrmc. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93ec67967f..a29dcd3a99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,10 +17,10 @@ jobs: with: path: "**/node_modules" key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Use Node.js from .nvrmc + - name: Use Node.js from .nvmrc uses: actions/setup-node@v3 with: - node-version-file: '.nvrmc' + node-version-file: '.nvmrc' - name: Install if: steps.yarn-cache.outputs.cache-hit != 'true' run: CYPRESS_INSTALL_BINARY=0 yarn install