Skip to content

Commit

Permalink
do not collect coverage when runing tests in GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bonukai committed Mar 8, 2022
1 parent 3214f26 commit 98754a5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Codecov
on:
push:
branches: [main]

pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-20.04
Expand All @@ -15,11 +17,11 @@ jobs:
with:
node-version: 17
- run: npm install
- run: npm run test
- run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: server/coverage/clover.xml
verbose: true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "npm run start --prefix server",
"format": "prettier --list-different --write .",
"lint": "npm run lint --prefix client && npm run lint --prefix server",
"test": "npm run test --prefix server"
"test": "npm run test --prefix server",
"test:coverage": "npm run test:coverage --prefix server"
},
"devDependencies": {
"@types/jest": "^27.4.1",
Expand Down
1 change: 0 additions & 1 deletion server/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ module.exports = {
'!src/i18n/locales',
],
reporters: ['default', 'jest-junit'],
collectCoverage: true,
};
4 changes: 2 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"homepage": "https://github.com/bonukai/MediaTracker#readme",
"scripts": {
"test": "cross-env DATABASE_PATH=:memory: jest",
"test:coverage": "cross-env DATABASE_PATH=:memory: jest --coverage",
"build:server": "babel src --out-dir build --extensions .ts --source-maps true --delete-dir-on-start",
"build:docs": "npm run build --prefix ../docs",
"build:routes": "babel-node --extensions .ts scripts/generateRoutes.ts && babel-node --extensions .ts scripts/generateApi.ts && npm run build --prefix ../rest-api",
Expand Down Expand Up @@ -116,4 +117,4 @@
"public"
],
"bin": "build/index.js"
}
}

0 comments on commit 98754a5

Please sign in to comment.