From 62f78b4028dd13862559cf0d94959f50efe4c51c Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Tue, 3 Mar 2026 13:22:17 +0000 Subject: [PATCH] Modify unit-ci to upload coverage --- .github/workflows/unit-ci.yml | 16 ++++++++++++---- vitest.config.unit.ts | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-ci.yml b/.github/workflows/unit-ci.yml index 506ec9a..a1e6455 100644 --- a/.github/workflows/unit-ci.yml +++ b/.github/workflows/unit-ci.yml @@ -30,8 +30,16 @@ jobs: - name: Install dependencies run: npm ci - - name: Install test dependencies (Playwright Chromium) - run: npm run test:install-dependencies + # unit tests do not require Playwright, so we can skip installing its dependencies to save time + # - name: Install test dependencies (Playwright Chromium) + # run: npm run test:install-dependencies - - name: Run unit tests suite - run: npm run test:unit \ No newline at end of file + - name: Run unit tests suite with coverage + run: npm run test:unit:coverage + + - name: Upload coverage report + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/** \ No newline at end of file diff --git a/vitest.config.unit.ts b/vitest.config.unit.ts index 6fbbaa5..90d44dd 100644 --- a/vitest.config.unit.ts +++ b/vitest.config.unit.ts @@ -26,7 +26,7 @@ export default mergeConfig( ...importOnlyFiles, ], provider: "v8", - reporter: ["text", "json", "html"], + reporter: ["text", "json", "html", ["text", { file: "coverage-text.txt" }]], }, }, })