Skip to content

Commit 98754a5

Browse files
committed
do not collect coverage when runing tests in GitHub actions
1 parent 3214f26 commit 98754a5

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Codecov
33
on:
44
push:
55
branches: [main]
6-
6+
pull_request:
7+
branches: [main]
8+
79
jobs:
810
build:
911
runs-on: ubuntu-20.04
@@ -15,11 +17,11 @@ jobs:
1517
with:
1618
node-version: 17
1719
- run: npm install
18-
- run: npm run test
20+
- run: npm run test:coverage
1921
- name: Upload coverage to Codecov
2022
uses: codecov/codecov-action@v2
2123
with:
22-
token: ${{ secrets.CODECOV_TOKEN }}
24+
token: ${{ secrets.CODECOV_TOKEN }}
2325
fail_ci_if_error: true
2426
files: server/coverage/clover.xml
2527
verbose: true

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"start": "npm run start --prefix server",
88
"format": "prettier --list-different --write .",
99
"lint": "npm run lint --prefix client && npm run lint --prefix server",
10-
"test": "npm run test --prefix server"
10+
"test": "npm run test --prefix server",
11+
"test:coverage": "npm run test:coverage --prefix server"
1112
},
1213
"devDependencies": {
1314
"@types/jest": "^27.4.1",

server/jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ module.exports = {
1515
'!src/i18n/locales',
1616
],
1717
reporters: ['default', 'jest-junit'],
18-
collectCoverage: true,
1918
};

server/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"homepage": "https://github.com/bonukai/MediaTracker#readme",
2121
"scripts": {
2222
"test": "cross-env DATABASE_PATH=:memory: jest",
23+
"test:coverage": "cross-env DATABASE_PATH=:memory: jest --coverage",
2324
"build:server": "babel src --out-dir build --extensions .ts --source-maps true --delete-dir-on-start",
2425
"build:docs": "npm run build --prefix ../docs",
2526
"build:routes": "babel-node --extensions .ts scripts/generateRoutes.ts && babel-node --extensions .ts scripts/generateApi.ts && npm run build --prefix ../rest-api",
@@ -116,4 +117,4 @@
116117
"public"
117118
],
118119
"bin": "build/index.js"
119-
}
120+
}

0 commit comments

Comments
 (0)