name: Coverage

# Controls when the workflow will run
on:
  pull_request:
    branches:
      - master
      - main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # build the npm project. Generates js files by compiling ts files
  coverage:
    permissions:
      checks: write
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3
      # sets up node environment
      - uses: actions/setup-node@v3
        with:
          node-version: '14.6.0'
      - run: npm install
      - run: npm run build
      - uses: ArtiomTr/jest-coverage-report-action@v2