diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index f0a5ab1c..652b71ea 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -26,3 +26,6 @@ jobs: pnpm test env: TEST_USER: ${{ steps.json.outputs.encoded }} + - name: Report Coverage + if: always() + uses: davelosert/vitest-coverage-report-action@v2 diff --git a/package.json b/package.json index 23883a9b..67b6d246 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint:ci": "pnpm -r lint:ci", "lint:fix": "pnpm -r lint:fix", "test": "pnpm -r test -- --run", + "test": "pnpm -r test:ci", "test:coverage": "pnpm -r test:coverage", "typecheck": "pnpm -r typecheck" }, diff --git a/packages/event-producer/package.json b/packages/event-producer/package.json index 5c210a00..b4bbabb0 100644 --- a/packages/event-producer/package.json +++ b/packages/event-producer/package.json @@ -30,6 +30,7 @@ "lint:fix": "pnpm run lint --fix", "preview": "vite preview", "test": "vitest --sequence.concurrent", + "test:ci": "pnpm run test:coverage --reporter=json-summary --reporter=json", "test:coverage": "pnpm run test --coverage", "test:ui": "pnpm run test:coverage --ui", "typecheck": "tsc" diff --git a/packages/player-web-components/vite.config.ts b/packages/player-web-components/vite.config.ts index fdde697a..3fb2c3bb 100644 --- a/packages/player-web-components/vite.config.ts +++ b/packages/player-web-components/vite.config.ts @@ -16,7 +16,14 @@ export default defineConfig({ }, test: { coverage: { + reportOnFailure: true, reporter: process.env.CI ? ['json', 'json-summary'] : ['html'], + thresholds: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, }, globals: true, restoreMocks: true,