Skip to content

Test new vitest coverage report action compare feature #15

Test new vitest coverage report action compare feature

Test new vitest coverage report action compare feature #15

name: "Test"
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:

Check failure on line 9 in .github/workflows/test-vitest-coverage-action.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-vitest-coverage-action.yml

Invalid workflow file

You have an error in your yaml syntax on line 9
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.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@add-trend-indicator-build
with:
json-summary-compare-path: coverage-main/coverage-summary.json