diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml new file mode 100644 index 00000000..5470c732 --- /dev/null +++ b/.github/workflows/code-coverage.yml @@ -0,0 +1,40 @@ +name: Tests & Code Coverage + +on: + push: + branches: + - master + - main + - "release/*" + pull_request: + branches: + - main + - master + types: + - opened + - synchronize + +jobs: + upload-code-coverage: + runs-on: ubuntu-latest + + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Set Node 10 + uses: actions/setup-node@v3 + with: + node-version: 10 + + - name: Install Node.js Dependencies + run: npm i + + - name: Run Tests + run: npm test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.gitignore b/.gitignore index d069f6cd..0c39e028 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,6 @@ typings/ # Optional npm cache directory .npm -.github # Optional eslint cache .eslintcache diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..bfdc9877 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true diff --git a/package.json b/package.json index 3e5e839b..eb2cb1f9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "dev": "TS_NODE_FILES=true NODE_ENV=development ts-node ./src/cli", "build": "rm -rf dist && yarn rudder-typer prod && tsc && copyfiles --up 1 \"src/**/*.hbs\" dist/src/", - "test": "jest --testPathIgnorePatterns 'tests/e2e/.*' 'example'", + "test": "jest --testPathIgnorePatterns 'tests/e2e/.*' 'example' --coverage", "e2e": "make e2e", "update": "make update", "lint": "eslint './src/**/*.{ts,tsx}'",