Skip to content

Commit

Permalink
Add test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
hartra344 committed May 7, 2024
1 parent dfdf7b8 commit 8c2d7bb
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/base-coverage.yml
@@ -0,0 +1,38 @@
name: Generate Base Main Coverage Report

on:
push:
branches: [main]
jobs:
base-coverage:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20.x

- uses: pnpm/action-setup@v3
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm turbo run test:lib --cache-dir=.turbo
- run: npx cobertura-merge-globby -o coverage.xml --files="**/cobertura-coverage.xml"
- uses: clearlyip/code-coverage-report-action@v4
with:
#Location of the generated coverage file
filename: 'coverage.xml'
2 changes: 1 addition & 1 deletion libs/chatbot/vitest.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,
alias: [
{
Expand Down
2 changes: 1 addition & 1 deletion libs/data-mapper-v2/vite.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,
alias: [
{
Expand Down
2 changes: 1 addition & 1 deletion libs/data-mapper/vite.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,
alias: [
{
Expand Down
2 changes: 1 addition & 1 deletion libs/designer-ui/vitest.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,
alias: [
{
Expand Down
2 changes: 1 addition & 1 deletion libs/designer/vitest.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,
alias: [
{
Expand Down
2 changes: 1 addition & 1 deletion libs/logic-apps-shared/vitest.config.ts
Expand Up @@ -11,7 +11,7 @@ export default defineProject({
globals: true,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
typecheck: { enabled: true },
restoreMocks: true,
},
Expand Down
2 changes: 1 addition & 1 deletion libs/vscode-extension/vitest.config.ts
Expand Up @@ -10,7 +10,7 @@ export default defineProject({
watch: false,
environment: 'jsdom',
setupFiles: ['test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'json'] },
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'], reporter: ['html', 'cobertura'] },
restoreMocks: true,

},
Expand Down

0 comments on commit 8c2d7bb

Please sign in to comment.