From 6c729b13aeecd661810f55129dffc03a8f5dce06 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Sun, 6 Aug 2023 16:16:04 +1000 Subject: [PATCH] Create coverage.yml add coverage workflow --- .github/workflows/coverage.yml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..3b904931 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,57 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, +# lint, build the source code, and run tests across different versions of node. + +# For more information see: +# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Coverage + +on: + workflow_dispatch: + pull_request: + branches: ['main'] + paths-ignore: ['README.md', 'LICENSE'] + +concurrency: + group: ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + VITEST_SEGFAULT_RETRY: 3 + +jobs: + coverage-on-node: + 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 install + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build + + - 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 }}