diff --git a/.github/workflows/deploy.docs.yml b/.github/workflows/deploy.docs.yml index 7cbe0f15..c4860d45 100644 --- a/.github/workflows/deploy.docs.yml +++ b/.github/workflows/deploy.docs.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - coverage-badge jobs: # Build job @@ -19,14 +20,26 @@ jobs: run: | npm install npm run build - npm link working-directory: ./ - name: Build static files id: build - run: npm install && npm run docs:generate + run: npm run docs:generate working-directory: ./ + - name: Generate coverage Badge + id: coverage + run: npm run test:unit + + - name: Create Coverage Badges + id: coverage-badge + uses: jaywcjlove/coverage-badges-cli@main + with: + style: flat + source: coverage/coverage-summary.json + output: docs/test.svg + jsonPath: totals.percent_covered + - name: Upload static files as artifact id: deployment uses: actions/upload-pages-artifact@v3.0.1 diff --git a/vite.config.ts b/vite.config.ts index c4ae05d2..d596e603 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ all: true, include: ['src/**/*.{js,jsx,ts,tsx}'], exclude: [...configDefaults.exclude, 'src/**/*.cy.tsx'], + reporter: ['html', 'json-summary'], thresholds: { lines: 1, functions: 59,