diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml new file mode 100644 index 00000000..4115980b --- /dev/null +++ b/.github/workflows/ci-check.yml @@ -0,0 +1,44 @@ +name: npm-ci-check + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Collect Workflow Telemetry + if: always() + uses: runforesight/foresight-workflow-kit-action@v1 + with: + api_key: ${{ secrets.FORESIGHT_PROD_API_KEY }} + + - name: Use Node.js 10.x + uses: actions/setup-node@v2 + with: + node-version: "10.x" + - name: NPM Install + run: npm install -D jest-junit-reporter + - name: NPM Linter + run: npm run lint + - name: Docker Up + run: docker-compose up -d + - name: NPM Test CI + run: npm run test -- --testResultsProcessor="./node_modules/jest-junit-reporter" + - name: Analyze Test and/or Coverage Results + if: always() + uses: runforesight/foresight-test-kit-action@v1 + with: + api_key: ${{ secrets.FORESIGHT_PROD_API_KEY }} + test_framework: jest + test_format: junit + test_path: "./test-report.xml" + + - name: Docker Stop + run: docker-compose stop diff --git a/jest.ci.config.js b/jest.ci.config.js index f2f66522..96f9e63e 100644 --- a/jest.ci.config.js +++ b/jest.ci.config.js @@ -8,6 +8,7 @@ module.exports = { '/test/opentracing/*.js', '/test/integration/*.js' ], + 'maxWorkers': 1, 'transform': { '.+\\.(js|jsx|ts|tsx)$': 'babel-jest' }, diff --git a/package.json b/package.json index 4cdaa80f..bcb30c58 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "rollup -c", "start": "npm-run-all --parallel watch:server watch:build", "test-automatic-instrumentation": "node ./test/instrumentation/automated.instrumentation.js", - "test": "npm run compile && npm run test-automatic-instrumentation && docker-compose up -d && jest --silent; docker-compose stop", + "test": "npm run compile && npm run test-automatic-instrumentation && jest --runInBand --detectOpenHandles --force-exit --silent --config jest.ci.config.js", "test-ci": "npm run compile && npm run test-automatic-instrumentation && jest --silent --config jest.ci.config.js --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", "lint": "tslint --project tsconfig.json -t stylish", "release-minor": "npm install; npm run build; release-it minor --ci --git.commit --git.push --git.tag --git.tagName='v${version}' --github.release --no-git.requireCleanWorkingDir --no-git.requireUpstream --npm.publish", @@ -101,7 +101,7 @@ "ioredis": "^4.10.0", "jest": "^27.0.0", "koa": "^2.13.1", - "mongodb": "^3.2.4", + "mongodb": "^3.6.3", "mysql": "^2.16.0", "mysql2": "2.1.0", "nock": "^10.0.6",