From b76fa9d72290988ac2c4cfa370f760e7ca683d29 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sat, 25 May 2024 19:56:24 +0200 Subject: [PATCH] ci: report vitest code coverage (#549) --- .github/workflows/code-quality.yml | 6 ++++++ vitest.config.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 44846a959..228dd9989 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -66,3 +66,9 @@ jobs: - name: Test run: pnpm test + + - name: 'Report Coverage' + # Set if: always() to also generate the report if tests are failing + # Only works if you set `reportOnFailure: true` in your vite config as specified above + if: always() + uses: davelosert/vitest-coverage-report-action@v2 diff --git a/vitest.config.ts b/vitest.config.ts index 9d5aec73d..5a9efb391 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -18,6 +18,7 @@ export default defineConfig({ reporter: ["html", "json-summary", "json"], all: true, exclude: ["apps/nextjs/.next/"], + reportOnFailure: true }, exclude: [...configDefaults.exclude, "apps/nextjs/.next"],