Compare commits

...

3 Commits

Author SHA1 Message Date
bymyself
dc610390c2 fix: correct Codecov action SHA pin (was truncated) 2026-03-26 22:08:40 -07:00
bymyself
21138e8e73 ci: add Codecov coverage upload to unit test workflow
- Run pnpm test:coverage instead of pnpm test:unit
- Upload lcov.info to Codecov after test run
- fail_ci_if_error: false so CI won't break if upload fails
- Codecov handles PR commenting via their GitHub App
2026-03-26 22:04:43 -07:00
bymyself
ae8448ed0c config: add vitest coverage include pattern and lcov reporter 2026-03-26 21:13:20 -07:00
3 changed files with 23 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
# Description: Unit and component testing with Vitest
# Description: Unit and component testing with Vitest + coverage reporting
name: 'CI: Tests Unit'
on:
@@ -23,5 +23,12 @@ jobs:
- name: Setup frontend
uses: ./.github/actions/setup-frontend
- name: Run Vitest tests
run: pnpm test:unit
- name: Run Vitest tests with coverage
run: pnpm test:coverage
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
files: coverage/lcov.info
fail_ci_if_error: false

View File

@@ -45,6 +45,7 @@
"stylelint": "stylelint --cache '{apps,packages,src}/**/*.{css,vue}'",
"test:browser": "pnpm exec nx e2e",
"test:browser:local": "cross-env PLAYWRIGHT_LOCAL=1 PLAYWRIGHT_TEST_URL=http://localhost:5173 pnpm test:browser",
"test:coverage": "vitest run --coverage",
"test:unit": "nx run test",
"typecheck": "vue-tsc --noEmit",
"typecheck:browser": "vue-tsc --project browser_tests/tsconfig.json",

View File

@@ -653,7 +653,18 @@ export default defineConfig({
'scripts/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'
],
coverage: {
reporter: ['text', 'json', 'html']
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['src/**/*.{ts,vue}'],
exclude: [
'src/**/*.test.ts',
'src/**/*.spec.ts',
'src/**/*.stories.ts',
'src/**/*.d.ts',
'src/locales/**',
'src/lib/litegraph/**',
'src/assets/**'
]
},
exclude: [
'**/node_modules/**',