Skip to content

Commit 30a3f10

Browse files
committed
ci: update environment
- test against Node.js v17, v18 - Test against MongoDB v3.6 and v5.0 - fix Travis CI config see: loopbackio/cicd#27 Signed-off-by: Rifa Achrinza <[email protected]>
1 parent 06b7239 commit 30a3f10

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

.github/workflows/continuous-integration.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
node-version: [10, 12, 14]
19-
mongodb-version: [4.4] # the latest stable version
18+
node-version: [10, 12, 14, 16, 17, 18]
19+
mongodb-version: [3.6, 4.4, 5.0] # the latest stable version
2020

2121
steps:
2222
- uses: actions/checkout@v2

.travis.yml

+27-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1+
branches:
2+
only: 5.x
3+
arch: arm64
4+
services: docker
15
language: node_js
26
node_js:
3-
- "10"
4-
- "12"
5-
- "14"
6-
7+
- 10
8+
- 12
9+
- 14
10+
- 16
11+
- 17
12+
- 18
713
env:
8-
- CXX=g++-4.8
9-
addons:
10-
apt:
11-
sources:
12-
- ubuntu-toolchain-r-test
13-
- mongodb-3.2-precise
14-
packages:
15-
- g++-4.8
16-
- mongodb-org-server
17-
- mongodb-org-shell
18-
services:
19-
- mongodb
20-
21-
after_success: npm run coverage
14+
- MONGO_VERSION=3.6
15+
- MONGO_VERSION=4.4
16+
- MONGO_VERSION=5.0
17+
before_install: |
18+
docker run --name=mongodb --publish=27017:27017 --detach mongo:"$MONGO_VERSION"
19+
until docker exec --tty mongodb mongo --port=27017 --eval='db.serverStatus()'
20+
do
21+
sleep 1
22+
echo "."
23+
TIMER="$(TIMER + 1)"
24+
if [ "$TIMER" -eq 20 ]; then
25+
echo "MongoDB did not initialize within 20 seconds. Exiting."
26+
exit 2
27+
fi
28+
done
29+
install: npm ci --ignore-scripts
30+
script: npm run-script test:ci

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"coverage": "nyc report --reporter=text-lcov | coveralls",
1515
"benchmarks": "make benchmarks",
1616
"leak-detection": "make leak-detection",
17-
"test": "nyc mocha test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js",
17+
"test": "npm run test:ci",
18+
"test:ci": "nyc mocha test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js",
1819
"lint": "eslint .",
1920
"posttest": "npm run lint"
2021
},

0 commit comments

Comments
 (0)