Skip to content

Commit 03155b3

Browse files
committed
chore: try moving CI to evergreen
1 parent 16215d0 commit 03155b3

File tree

4 files changed

+176
-34
lines changed

4 files changed

+176
-34
lines changed

.evergreen.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
exec_timeout_secs: 600
2+
3+
functions:
4+
checkout:
5+
- command: git.get_project
6+
params:
7+
directory: src
8+
install_node:
9+
- command: shell.exec
10+
params:
11+
working_dir: src
12+
shell: bash
13+
script: |
14+
set -e
15+
set -x
16+
17+
export NODE_VERSION=16.19.0
18+
bash .evergreen/install-node.sh
19+
install:
20+
- command: shell.exec
21+
params:
22+
working_dir: src
23+
shell: bash
24+
script: |
25+
set -e
26+
set -x
27+
28+
. .evergreen/use-node.sh
29+
npm ci
30+
check:
31+
- command: shell.exec
32+
params:
33+
working_dir: src
34+
shell: bash
35+
script: |
36+
set -e
37+
set -x
38+
39+
. .evergreen/use-node.sh
40+
npm run build
41+
npm run lint
42+
test:
43+
- command: shell.exec
44+
params:
45+
working_dir: src
46+
shell: bash
47+
env:
48+
OKTA_TEST_CONFIG: ${okta_test_config}
49+
OKTA_TEST_CREDENTIALS: ${okta_test_credentials}
50+
AZURE_TEST_CONFIG: ${azure_test_config}
51+
AZURE_TEST_CREDENTIALS: ${azure_test_credentials}
52+
DISTRO_ID: ${distro_id}
53+
script: |
54+
set -e
55+
set -x
56+
57+
. .evergreen/use-node.sh
58+
npm run build
59+
npm run test-ci
60+
61+
tasks:
62+
- name: test_n14
63+
commands:
64+
- func: checkout
65+
- func: install_node
66+
- func: install
67+
- func: test
68+
vars:
69+
node_version: "14.21.3"
70+
- name: test_16
71+
commands:
72+
- func: checkout
73+
- func: install_node
74+
- func: install
75+
- func: test
76+
vars:
77+
node_version: "16.20.1"
78+
- name: test_n18
79+
commands:
80+
- func: checkout
81+
- func: install_node
82+
- func: install
83+
- func: test
84+
vars:
85+
node_version: "18.17.0"
86+
- name: test_n20
87+
commands:
88+
- func: checkout
89+
- func: install_node
90+
- func: install
91+
- func: test
92+
vars:
93+
node_version: "20.5.0"
94+
- name: check
95+
commands:
96+
- func: checkout
97+
- func: install_node
98+
- func: install
99+
- func: check
100+
101+
buildvariants:
102+
- name: ubuntu_x64_test
103+
display_name: 'Ubuntu 20.04 x64'
104+
run_on: ubuntu2004-large
105+
tasks:
106+
- test_n14
107+
- test_n16
108+
- test_n18
109+
- test_n20
110+
- check
111+
- name: macos_x64_test
112+
display_name: 'macOS 11.00 x64'
113+
run_on: macos-1100
114+
tasks:
115+
- test_n14
116+
- test_n16
117+
- test_n18
118+
- test_n20
119+
- name: macos_arm64_test
120+
display_name: 'macOS 11.00 arm64'
121+
run_on: macos-1100-arm64
122+
tasks:
123+
- test_n14
124+
- test_n16
125+
- test_n18
126+
- test_n20
127+
- name: windows_x64_test
128+
display_name: 'Windows x64'
129+
run_on: windows-vsCurrent-large
130+
tasks:
131+
- test_n14
132+
- test_n16
133+
- test_n18
134+
- test_n20

.evergreen/install-node.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# adapted from the Node.js driver's script for installing Node.js
3+
set -e
4+
set -x
5+
6+
export BASEDIR="$PWD"
7+
mkdir -p .deps
8+
cd .deps
9+
10+
NVM_URL="https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh"
11+
12+
# this needs to be explicitly exported for the nvm install below
13+
export NVM_DIR="$PWD/nvm"
14+
export XDG_CONFIG_HOME=$PWD
15+
16+
# install Node.js on Windows
17+
if [[ "$OS" == "Windows_NT" ]]; then
18+
curl -o node.zip "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-win-x64.zip"
19+
unzip node.zip
20+
mkdir -p node/bin
21+
mv -v node-v$NODE_VERSION-win-x64/* node/bin
22+
chmod a+x node/bin/*
23+
export PATH="$PWD/node/bin:$PATH"
24+
# install Node.js on Linux/MacOS
25+
else
26+
curl -o- $NVM_URL | bash
27+
set +x
28+
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh"
29+
nvm install --no-progress "$NODE_VERSION"
30+
fi
31+
32+
which node && node -v || echo "node not found, PATH=$PATH"
33+
which npm && npm -v || echo "npm not found, PATH=$PATH"

.evergreen/use-node.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if [[ "$OS" == "Windows_NT" ]]; then
2+
export PATH="$PWD/.deps/node/bin:$PATH"
3+
else
4+
export NVM_DIR="$PWD/.deps/nvm"
5+
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
6+
fi
7+
8+
echo "updated PATH=$PATH"

.github/workflows/nodejs.yml

+1-34
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-latest, macos-latest]
15+
os: [ubuntu-latest]
1616
node-version: [14.x, 16.x, 18.x, 19.x]
1717
runs-on: ${{ matrix.os }}
1818
steps:
@@ -29,36 +29,3 @@ jobs:
2929
run: npm install
3030
- name: Test
3131
run: npm test
32-
33-
test-windows:
34-
name: Windows tests
35-
strategy:
36-
fail-fast: false
37-
matrix:
38-
node-version: [14.x, 16.x, 18.x, 19.x]
39-
shard: [1, 2, 3, 4, 5]
40-
runs-on: windows-latest
41-
steps:
42-
- uses: actions/checkout@v2
43-
- name: Install python
44-
uses: actions/setup-python@v2
45-
with:
46-
python-version: '3.10'
47-
- name: Install Node.js build deps
48-
run: choco install nasm
49-
- name: Install developer command prompt
50-
uses: ilammy/msvc-dev-cmd@v1
51-
- name: Use Node.js ${{ matrix.node-version }}
52-
uses: actions/setup-node@v2
53-
with:
54-
check-latest: true
55-
node-version: ${{ matrix.node-version }}
56-
- name: Install [email protected]
57-
if: ${{ matrix.node-version == '14.x' }}
58-
run: npm install -g [email protected]
59-
- name: Install Dependencies
60-
run: npm install
61-
- name: Sharded tests
62-
run: npm test -- -g "shard ${{ matrix.shard }}"
63-
- name: Unsharded tests
64-
run: npm test -- -g "shard [1-5]" -i

0 commit comments

Comments
 (0)