Skip to content

ci: added vitest coverage report #93

ci: added vitest coverage report

ci: added vitest coverage report #93

Workflow file for this run

name: Test Workflow
on: ["push", "pull_request"]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- ${{ github.head_ref }}
- "master"
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: ${{ matrix.branch }}
- name: Setup Node.js environment
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: "20.x"
- name: Install dependencies
run: npm install
- name: Run tests
run: npx vitest --coverage.enabled true
- name: Upload Coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.branch }}
path: coverage
report-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: "Download Coverage Artifacts"
uses: actions/download-artifact@v4
with:
name: coverage-${{ github.head_ref }}
path: coverage
- uses: actions/download-artifact@v4
with:
name: coverage-main
path: coverage-main
- name: "Report Coverage"
uses: davelosert/vitest-coverage-report-action@v2
with:
json-summary-compare-path: coverage-main/coverage-summary.json