Skip to content

Commit

Permalink
Upgrade to Node 20 & simplify CI Node install (#431)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Cruikshanks authored Sep 23, 2023
1 parent ea86dfe commit 548e4b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20

0 comments on commit 548e4b7

Please sign in to comment.