Skip to content

Commit

Permalink
feat(ci/cd): add coverage test to actions
Browse files Browse the repository at this point in the history
* remove main.ts from coverage
  • Loading branch information
martendebruijn committed Jul 20, 2024
1 parent 524ee77 commit c90bc02
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4
- uses: actions/setup-node@v4
- uses: actions/setup-node@v3
with:
node-version: 'lts'
- run: npm ci
- run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4
- uses: actions/setup-node@v3
with:
node-version: 'lts'
- run: npm ci
- run: npm run test:coverage
- uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage/**/*
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"format": "prettier --write src/ scripts/",
"lint": "eslint src/**/*.ts",
"test": "vitest",
"coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage"
},
"keywords": [
"types",
Expand Down
3 changes: 3 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export default defineConfig({
ignoreSourceErrors: true,
tsconfig: './src/tsconfig.json',
},
coverage: {
exclude: ['*/**/main.ts'],
},
},
})

0 comments on commit c90bc02

Please sign in to comment.