Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Comment and upload code coverage

License

Notifications You must be signed in to change notification settings

reside-eng/code-coverage-action

Repository files navigation

code-coverage-action

Comments and uploads code coverage for global reporting

NPM version Build Status License semantic-release Code Style

Use

  1. Call action in your workflow after running tests with coverage report generation:
name: Verify

on: [pull_request]

env:
  NODE_VERSION: 16.x

jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    if: github.actor != 'dependabot[bot]'
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2.3.4

      - name: Use Node.js ${{ env.NODE_VERSION }}
        uses: actions/setup-node@v2.4.0
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: "yarn"

      - name: Install dependencies
        run: yarn install --frozen-lockfile

      - name: Verify lint
        run: yarn lint

      - name: Test
        run: yarn test --coverage --coverageReporters="json-summary"

      - name: Report Coverage
        uses: reside-eng/code-coverage-action@v1.0.0
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}