From 548e4b74aa509f94fc3cf09b32c52889202da43f Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Sat, 23 Sep 2023 11:11:12 +0100 Subject: [PATCH] Upgrade to Node 20 & simplify CI Node install (#431) https://eaflood.atlassian.net/browse/WATER-4077 Our environments are currently running on Node.js Version 14. [v14 went end-of-life in April 2023](https://endoflife.date/nodejs) which means no more maintenance or security fixes will be provided. The current Long Term Support (LTS) version is currently v18 though in a couple of weeks it will switch to v20. So, we're updating our environments to run with Node v20. This covers all changes needed to support the upgrade. While doing this we spotted that https://github.com/actions/setup-node supports setting the version using the .nvmrc file directly. So, we also used this opportunity to simplify our CI workflow. --- .github/workflows/ci.yml | 10 +--------- .nvmrc | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 134bac34dd..2a141bdff8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,18 +74,10 @@ jobs: run: | ! grep -R 'describe.only(\|it.only(' test - # Our projects use .nvmrc files to specify the node version to use. We can read and then output it as the result - # this step. Subsequent steps can then access the value - - name: Read Node version - run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" - # Give the step an ID to make it easier to refer to - id: nvm - - # Gets the version to use by referring to the previous step - name: Install Node uses: actions/setup-node@v3 with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" + node-version-file: ".nvmrc" # Speeds up workflows by reading the node modules from cache. Obviously you need to run it at least once, and the # cache will be updated should the package-lock.json file change diff --git a/.nvmrc b/.nvmrc index b6a7d89c68..209e3ef4b6 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +20