name: code-coverage

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test-coverage:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - uses: r-lib/actions/setup-r@v2
        with:
          r-version: 'release'
      - uses: r-lib/actions/setup-pandoc@v2
      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: covr
      - name: Test coverage
        env:
          NOT_CRAN: true
        run: covr::codecov()
        shell: Rscript {0}
