Skip to content

Commit

Permalink
ci: update environment
Browse files Browse the repository at this point in the history
- 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 <25147899+achrinza@users.noreply.github.com>
  • Loading branch information
achrinza committed Apr 20, 2022
1 parent 06b7239 commit 30a3f10
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10, 12, 14]
mongodb-version: [4.4] # the latest stable version
node-version: [10, 12, 14, 16, 17, 18]
mongodb-version: [3.6, 4.4, 5.0] # the latest stable version

steps:
- uses: actions/checkout@v2
Expand Down
45 changes: 27 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
branches:
only: 5.x
arch: arm64
services: docker
language: node_js
node_js:
- "10"
- "12"
- "14"

- 10
- 12
- 14
- 16
- 17
- 18
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- mongodb-3.2-precise
packages:
- g++-4.8
- mongodb-org-server
- mongodb-org-shell
services:
- mongodb

after_success: npm run coverage
- MONGO_VERSION=3.6
- MONGO_VERSION=4.4
- MONGO_VERSION=5.0
before_install: |
docker run --name=mongodb --publish=27017:27017 --detach mongo:"$MONGO_VERSION"
until docker exec --tty mongodb mongo --port=27017 --eval='db.serverStatus()'
do
sleep 1
echo "."
TIMER="$(TIMER + 1)"
if [ "$TIMER" -eq 20 ]; then
echo "MongoDB did not initialize within 20 seconds. Exiting."
exit 2
fi
done
install: npm ci --ignore-scripts
script: npm run-script test:ci
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"benchmarks": "make benchmarks",
"leak-detection": "make leak-detection",
"test": "nyc mocha test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js",
"test": "npm run test:ci",
"test:ci": "nyc mocha test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js",
"lint": "eslint .",
"posttest": "npm run lint"
},
Expand Down

0 comments on commit 30a3f10

Please sign in to comment.