-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(codecov): upload coverage #65
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
codecov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
- run: yarn install | ||
- run: yarn test | ||
- uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
coverage: | ||
status: | ||
patch: off | ||
project: | ||
default: | ||
target: 100% | ||
threshold: 10% | ||
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 테스트 커버리지 목표: 100% threshold 10%라서 90%의 테스트 커버리가 넘지 못하는 PR은 PR status check에서 x를 받게 됩니다 |
||
|
||
comment: | ||
layout: 'header, reach, diff, flags, components' | ||
|
||
ignore: | ||
- '**/*.test-d.*' | ||
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. codecov에서 test-d파일은 아직 테스트코드로 보지 않고 있습니다. 하지만 test-d는 vitest에서 타입테스트를 위해서 사용되고 있습니다. 커버율에 포함되지 않게 처리했습니다. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ | |
"changeset:publish": "changeset publish", | ||
"changeset:version": "changeset version", | ||
"packlint": "packlint sort -R", | ||
"test": "vitest", | ||
"test": "vitest run --coverage --typecheck", | ||
"test:watch": "vitest --ui --coverage --typecheck", | ||
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"typecheck": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
|
@@ -47,13 +48,15 @@ | |
"@types/node": "^20.11.30", | ||
"@typescript-eslint/eslint-plugin": "^5.39.0", | ||
"@typescript-eslint/parser": "^5.39.0", | ||
"@vitest/coverage-istanbul": "^1.5.0", | ||
"@vitest/ui": "^1.5.0", | ||
"eslint": "^7", | ||
"eslint-config-prettier": "^8.5.0", | ||
"packlint": "^0.2.4", | ||
"prettier": "^3.2.5", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.3", | ||
"vitest": "^1.4.0" | ||
"vitest": "^1.5.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
import packageJson from './package.json'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
name: packageJson.name, | ||
dir: './src', | ||
coverage: { | ||
provider: 'istanbul', | ||
include: ['src/**/*'], | ||
}, | ||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test coverage를 측정하기 시작합니다 |
||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secret에 추가필요