Skip to content

Commit

Permalink
ci(NODE-6561): run on matrix of supported node versions (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
W-A-James authored Nov 25, 2024
1 parent 30b48eb commit 727cc1f
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 6 deletions.
84 changes: 80 additions & 4 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ functions:
- '.evergreen/run-tests.sh'
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
NODE_LTS_VERSION: ${NODE_LTS_VERSION}
run tests ubuntu:
- command: subprocess.exec
type: test
Expand All @@ -47,6 +48,7 @@ functions:
working_dir: src
env:
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
NODE_LTS_VERSION: ${NODE_LTS_VERSION}
PROJECT: ${project}
GYP_DEFINES: ${GYP_DEFINES|}
args:
Expand All @@ -64,6 +66,10 @@ functions:
- DRIVERS_TOOLS=/drivers-tools
- '--env'
- GYP_DEFINES
- '--env'
- NODE_LTS_VERSION=${NODE_LTS_VERSION}
- '--env'
- NPM_VERSION=${NPM_VERSION}
- 'ubuntu:22.04'
- /bin/bash
- /app/.evergreen/run-tests-ubuntu.sh
Expand Down Expand Up @@ -114,23 +120,93 @@ tasks:
- func: run prebuild

buildvariants:
- name: ubuntu2204-64
display_name: 'Ubuntu 22.04 64-bit'
- name: ubuntu2204-x64-node-16
display_name: 'Ubuntu 22.04 x64 - Node 16'
run_on: ubuntu2204-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: x86_64
NODE_LTS_VERSION: "16"
NPM_VERSION: "9"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-x64-node-18
display_name: 'Ubuntu 22.04 x64 - Node 18'
run_on: ubuntu2204-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: x86_64
NODE_LTS_VERSION: "18"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-x64-node-20
display_name: 'Ubuntu 22.04 x64 - Node 20'
run_on: ubuntu2204-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: x86_64
NODE_LTS_VERSION: "20"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-x64-node-22
display_name: 'Ubuntu 22.04 x64 - Node 22'
run_on: ubuntu2204-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: x86_64
NODE_LTS_VERSION: "22"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-arm64-node-16
display_name: 'Ubuntu 22.04 arm64 - Node 16'
run_on: ubuntu2204-arm64-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: arm64
NODE_LTS_VERSION: "16"
NPM_VERSION: "9"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-arm64-node-18
display_name: 'Ubuntu 22.04 arm64 - Node 18'
run_on: ubuntu2204-arm64-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: arm64
NODE_LTS_VERSION: "18"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-arm64-node-20
display_name: 'Ubuntu 22.04 arm64 - Node 20'
run_on: ubuntu2204-arm64-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: arm64
NODE_LTS_VERSION: "20"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
- name: ubuntu2204-arm64
display_name: 'Ubuntu 22.04 arm64'
- name: ubuntu2204-arm64-node-22
display_name: 'Ubuntu 22.04 arm64 - Node 22'
run_on: ubuntu2204-arm64-small
expansions:
has_packages: true
packager_distro: ubuntu2204
packager_arch: arm64
NODE_LTS_VERSION: "22"
tasks:
- run-tests-ubuntu
- run-tests-ubuntu-rtld
2 changes: 2 additions & 0 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export NODE_LTS_VERSION=${NODE_LTS_VERSION:-14}
# a version lower than latest to support EOL Node versions.
export NPM_VERSION=${NPM_VERSION:-latest}

echo "Installing Node.js $NODE_LTS_VERSION with npm@$NPM_VERSION"

source $DRIVERS_TOOLS/.evergreen/install-node.sh

npm install --build-from-source
Expand Down
5 changes: 3 additions & 2 deletions .evergreen/run-tests-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export KERBEROS_PORT="80"
export KERBEROS_HOSTNAME=$HOSTNAME.$KERBEROS_REALM
export DEBIAN_FRONTEND=noninteractive

export NODE_LTS_VERSION=$NODE_LTS_VERSION

echo "Installing all the packages required in this test"
apt-get update
apt-get -y -qq install \
Expand Down Expand Up @@ -123,8 +125,7 @@ else
echo -e "SUCCESS: Apache site built and set for Kerberos auth\nActual Output:\n$CURL_OUTPUT"
fi

echo "Run: install Node.js 20"
export NODE_LTS_VERSION=20
echo "Run: install Node.js"
source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"

npm test

0 comments on commit 727cc1f

Please sign in to comment.