Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Add ci-test GH workflow #335

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions jest.ci.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'<rootDir>/test/opentracing/*.js',
'<rootDir>/test/integration/*.js'
],
'maxWorkers': 1,
'transform': {
'.+\\.(js|jsx|ts|tsx)$': 'babel-jest'
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down