a b/.github/workflows/test-coverage.yaml
1
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3
on:
4
  push:
5
    branches: [dev, master, release-*]
6
  pull_request:
7
    branches: [dev, master]
8
9
name: test-coverage
10
11
jobs:
12
  test-coverage:
13
    runs-on: ubuntu-latest
14
    env:
15
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16
17
    steps:
18
      - uses: actions/checkout@v3
19
20
      - uses: r-lib/actions/setup-r@v2
21
        with:
22
          use-public-rspm: true
23
24
      - uses: r-lib/actions/setup-r-dependencies@v2
25
        with:
26
          extra-packages: any::covr
27
          needs: coverage
28
29
      - name: Test coverage
30
        run: |
31
          covr::codecov(
32
            quiet = FALSE,
33
            clean = FALSE,
34
            install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35
          )
36
        shell: Rscript {0}
37
38
      - name: Show testthat output
39
        if: always()
40
        run: |
41
          ## --------------------------------------------------------------------
42
          find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43
        shell: bash
44
45
      - name: Upload test results
46
        if: failure()
47
        uses: actions/upload-artifact@v3
48
        with:
49
          name: coverage-test-failures
50
          path: ${{ runner.temp }}/package