Skip to content

Commit

Permalink
ci: collect server coverage report (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 authored Apr 18, 2023
1 parent 346484e commit c895c18
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ jobs:
- name: Run server tests
run: yarn test:coverage
working-directory: apps/server
- name: Upload server test coverage results
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./apps/server/.coverage/lcov.info
flags: server-test
name: affine
fail_ci_if_error: true

e2e-test:
name: E2E Test
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ jobs:
- name: Run server tests
run: yarn test:coverage
working-directory: apps/server
- name: Upload server test coverage results
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./apps/server/.coverage/lcov.info
flags: server-test
name: affine
fail_ci_if_error: true

storybook-test:
name: Storybook Test
Expand Down
14 changes: 13 additions & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"dev": "nodemon ./src/index.ts",
"test": "NODE_ENV=test node --loader ts-node/esm.mjs --es-module-specifier-resolution node --test ./src/tests/*",
"test:coverage": "NODE_V8_COVERAGE=.coverage NODE_ENV=test node --loader ts-node/esm.mjs --es-module-specifier-resolution node --experimental-test-coverage ./src/tests/*"
"test:coverage": "NODE_ENV=test c8 node --loader ts-node/esm.mjs --es-module-specifier-resolution node --experimental-test-coverage ./src/tests/*"
},
"dependencies": {
"@apollo/server": "^4.6.0",
Expand All @@ -29,6 +29,7 @@
"@nestjs/testing": "^9.4.0",
"@types/lodash-es": "^4.14.194",
"@types/node": "^18.15.11",
"c8": "^7.13.0",
"nodemon": "^2.0.22",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
Expand All @@ -55,5 +56,16 @@
"DEBUG_COLORS": true
},
"delay": 1000
},
"c8": {
"reporter": [
"text",
"lcov"
],
"report-dir": ".coverage",
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
}
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ __metadata:
"@prisma/client": ^4.12.0
"@types/lodash-es": ^4.14.194
"@types/node": ^18.15.11
c8: ^7.13.0
dotenv: ^16.0.3
graphql: ^16.6.0
graphql-type-json: ^0.3.2
Expand Down Expand Up @@ -9830,7 +9831,7 @@ __metadata:
languageName: node
linkType: hard

"c8@npm:^7.6.0":
"c8@npm:^7.13.0, c8@npm:^7.6.0":
version: 7.13.0
resolution: "c8@npm:7.13.0"
dependencies:
Expand Down

2 comments on commit c895c18

@vercel
Copy link

@vercel vercel bot commented on c895c18 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on c895c18 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

affine-storybook – ./packages/component

affine-storybook-toeverything.vercel.app
affine-storybook-git-master-toeverything.vercel.app
affine-storybook.vercel.app

Please sign in to comment.