Skip to content

Commit

Permalink
feat: adding support for node 18, dropping node 12 (#406)
Browse files Browse the repository at this point in the history
* feat: adding support for node 18, dropping node 12

* chore: bump the root lockfile

* ci: installing the latest npm 8 in most environmnets

* ci: install npm8 everywhere in ci

* ci: debugging

* fix: add --ignore-scripts to `npm ci` in github action

I think we were reliant on buggy behaviour in npm@7 where `npm ci`
wasn't running some of the lifecycle hooks:
npm/cli#1905 (comment)

This got fixed in npm@8 but now our CI process breaks:
npm/cli@d825e90

Decided to follow the recommendations from husky's docs to do this so it
doesnt run the `prepare` step:

```sh
npm ci --ignore-scripts
```

https://github.com/typicode/husky/blob/0bcdac6b4dad6eedecc49cf3837ecc05b321db2e/docs/README.md#disable-husky-in-cidockerprod=

Co-authored-by: Dom Harrington <[email protected]>
  • Loading branch information
erunion and domharrington authored Apr 21, 2022
1 parent 284a420 commit 2d109b1
Show file tree
Hide file tree
Showing 6 changed files with 744 additions and 1,414 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ jobs:
# node 16.14.2 ships with a buggy version of npm 🤷‍♂️
# https://github.com/nodejs/node/issues/42397
# TODO revert this back to 16.x when node pushes a new version
node-version: [12.x, 14.x, 16.14.0]
node-version:
- 14
- 16.14.0
- 18

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install npm@7
run: npm install -g npm@7

- name: Install deps
run: npm ci

- name: Run tests
run: npm test
# Node 14 still ships with npm@6 so for compatibility reasons we're upping
# this to match everything else.
- name: Install npm@8
if: matrix.node-version == '14'
run: npm install -g npm@8

env:
CI: true
- run: npm ci --ignore-scripts
- run: npm test
Loading

0 comments on commit 2d109b1

Please sign in to comment.