Upload Test Coverage #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean installation of node dependencies, cache/restore them, | |
# lint, build the source code, run tests on one version of node, and upload coverage data. | |
# For more information see: | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Upload Test Coverage | |
on: | |
workflow_dispatch: | |
concurrency: | |
group: ci-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
env: | |
VITEST_SEGFAULT_RETRY: 3 | |
jobs: | |
upload-coverage: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install | |
run: npm clean-install --progress=false --no-fund | |
# - name: Lint | |
# run: npm run lint --if-present | |
# - name: Build | |
# run: npm run build --if-present | |
- name: Test | |
run: npm run test-coverage -- --coverage.reporter=json | |
- name: Upload coverage reports to Codecov | |
if: ${{ success() }} | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |