Skip to content

Commit

Permalink
ci: test more node versions (#1130)
Browse files Browse the repository at this point in the history
- test node v21
- explicitly test the lowest supported node version: v14.0.0

---------

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Dec 6, 2023
1 parent 0bcc837 commit 5c8bf59
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ jobs:
node-version:
## action based on https://github.com/actions/node-versions/releases
## see also: https://nodejs.org/en/about/releases/
- '20' # Current
- '18' # Active LTS
- '21' # Current
- '20' # LTS
- '18'
- '16'
- '14'
- '14.0.0' # lowest supported
os:
- ubuntu-latest
- windows-latest
Expand All @@ -102,12 +104,28 @@ jobs:
shell: bash
run: |
set -ex
## dont install all the dev-packages, especially since some are not runnable on node 14.0.0
dep_constraints=''
dev_requirements='jest jest-junit imurmurhash fast-glob'
# as long as npm cannot auto-resolve engine-constraints, we need to help here
case '${{ matrix.node-version }}' in
'14')
dep_constraints='normalize-package-data@^5'
;;
'14.0.0')
dep_constraints='normalize-package-data@^3'
dev_requirements='jest@^26 jest-junit imurmurhash fast-glob'
;;
esac
## !! dont install all the dev-packages, especially since some are not runnable on node 14.0.0
if [[ -n "$dep_constraints" ]]
then
npm add --ignore-scripts --omit=dev --only=prod --production --loglevel=silly --save $dep_constraints
fi
npm i --ignore-scripts --omit=dev --only=prod --production --loglevel=silly
## rebuild deps for which scripts were ignored, or partially installed - since "ignore-scripts" was used
npm rebuild --loglevel=silly libxmljs2 || npm uninstall --no-save libxmljs2
## install the needed dev-deps
npm i --no-save jest jest-junit imurmurhash fast-glob
npm i --ignore-scripts --loglevel=silly --no-save $dev_requirements
- name: fetch build artifact
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@v3
Expand Down
3 changes: 1 addition & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
; see the docs: https://docs.npmjs.com/cli/v9/using-npm/config

; engine-strict=true
engine-strict=true
package-lock=false

0 comments on commit 5c8bf59

Please sign in to comment.