generate coverage badge

generate coverage badge in docs generation workflow in order to upload
it with the documentation
This commit is contained in:
Ulf Gebhardt 2025-02-26 03:25:39 +01:00
parent 0169f1c8bc
commit 8705d8e14f
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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,