Skip to content

Build your personal knowledge base with Trilium Notes

feat(ci): add Commons to codecov

Elian Dorana2deabbaad65
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 150b1ca703..9f7316096b 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -114,8 +114,19 @@ jobs:
flags: desktop
fail_ci_if_error: false
+ - name: Run the commons tests
+ run: pnpm run --filter=commons test --coverage
+
+ - name: Upload commons coverage to Codecov
+ uses: codecov/codecov-action@v5
+ if: always()
+ with:
+ files: packages/commons/test-output/vitest/coverage/lcov.info
+ flags: commons
+ fail_ci_if_error: false
+
- name: Run the rest of the tests
- run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!ckeditor5-mermaid --filter=\!ckeditor5-math test
+ run: pnpm run --filter=\!client --filter=\!standalone --filter=\!server --filter=\!desktop --filter=\!commons --filter=\!ckeditor5-mermaid --filter=\!ckeditor5-math test
build_docker:
name: Build Docker image
diff --git a/codecov.yml b/codecov.yml
index 86cfb815d8..1802a306b4 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -28,6 +28,10 @@ flags:
paths:
- apps/desktop/src/
carryforward: true
+ commons:
+ paths:
+ - packages/commons/src/
+ carryforward: true
comment:
layout: "condensed_header, condensed_files, condensed_footer"
diff --git a/packages/commons/vite.config.ts b/packages/commons/vite.config.ts
index 51134eb87e..642428bd53 100644
--- a/packages/commons/vite.config.ts
+++ b/packages/commons/vite.config.ts
@@ -14,6 +14,7 @@ export default defineConfig(() => ({
'coverage': {
'reportsDirectory': './test-output/vitest/coverage',
'provider': 'v8' as const,
+ 'reporter': ['text', 'html', 'lcov'],
}
},
}));