Skip to content

Commit

Permalink
ci(codecov): upload coverage (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli authored Apr 21, 2024
1 parent 607f1f1 commit 28f1499
Show file tree
Hide file tree
Showing 5 changed files with 552 additions and 54 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/codecov.yml
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 }}
13 changes: 13 additions & 0 deletions codecov.yml
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:
layout: 'header, reach, diff, flags, components'

ignore:
- '**/*.test-d.*'
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
Expand All @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions vitest.config.mts
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/**/*'],
},
},
});
Loading

0 comments on commit 28f1499

Please sign in to comment.