diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index f839f4551..5e3adeb40 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml index 362fa69cd..cd9a03ee0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/package.json b/package.json index 2e44ccd68..4256c6205 100644 --- a/package.json +++ b/package.json @@ -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" },