Skip to content

Commit

Permalink
Test new vitest coverage report action compare feature
Browse files Browse the repository at this point in the history
  • Loading branch information
davelosert authored Dec 23, 2023
1 parent d39ae88 commit d5df38b
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/test-vitest-coverage-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,46 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [${{ github.head_ref }}, 'main']

permissions:
# Required to checkout the code
contents: read

steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: "Install Node"
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: "Install Deps"
run: npm install
- name: "Test"
run: npx vitest --coverage

run: npx vitest --coverage.enabled true
- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: coverage
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@add-trend-indicator-build
with:
json-summary-compare-path: coverage-main/coverage-summary.json

0 comments on commit d5df38b

Please sign in to comment.