christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 1 | # Workflow derived from https://github.com/r-lib/actions/tree/master/examples |
| 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help |
| 3 | # |
| 4 | # NOTE: This workflow is overkill for most R packages and |
| 5 | # check-standard.yaml is likely a better choice. |
| 6 | # usethis::use_github_action("check-standard") will install it. |
| 7 | on: |
| 8 | push: |
| 9 | branches: [main, master] |
Christophe Dervieux | 7f1add5 | 2021-09-15 15:42:07 +0200 | [diff] [blame] | 10 | paths-ignore: |
| 11 | - 'pkgdown/**' |
| 12 | - '.github/workflows/pkgdown.yaml' |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 13 | pull_request: |
| 14 | branches: [main, master] |
christophe dervieux | 66ea666 | 2021-09-15 15:49:12 +0200 | [diff] [blame] | 15 | paths-ignore: |
Christophe Dervieux | 7f1add5 | 2021-09-15 15:42:07 +0200 | [diff] [blame] | 16 | - 'pkgdown/**' |
| 17 | - '.github/workflows/pkgdown.yaml' |
| 18 | |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 19 | |
| 20 | name: R-CMD-check |
| 21 | |
| 22 | jobs: |
| 23 | R-CMD-check: |
| 24 | runs-on: ${{ matrix.config.os }} |
| 25 | |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 26 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) [Pandoc ${{ matrix.config.pandoc }}] |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 27 | |
| 28 | strategy: |
| 29 | fail-fast: false |
| 30 | matrix: |
| 31 | config: |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 32 | # testing R release with last shipped pandoc version in RStudio IDE and new pandoc |
| 33 | - {os: macOS-latest, pandoc: '2.11.4', r: 'release'} |
| 34 | - {os: macOS-latest, pandoc: '2.14.2', r: 'release'} |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 35 | |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 36 | # TODO: issue on windows with pandoc 2.11.4 - change when fixed |
| 37 | - {os: windows-latest, pandoc: '2.7.3', r: 'release'} |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 38 | # Use 3.6 to trigger usage of RTools35 |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 39 | - {os: windows-latest, pandoc: '2.7.3', r: '3.6'} |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 40 | |
| 41 | # Use older ubuntu to maximise backward compatibility |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 42 | - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'devel', http-user-agent: 'release'} |
| 43 | - {os: ubuntu-18.04, pandoc: 'devel', r: 'release'} |
| 44 | - {os: ubuntu-18.04, pandoc: '2.14.2', r: 'release'} |
| 45 | - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'release'} |
| 46 | - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'oldrel-1'} |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 47 | |
| 48 | env: |
| 49 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 50 | R_KEEP_PKG_SOURCE: yes |
| 51 | |
| 52 | steps: |
| 53 | - uses: actions/checkout@v2 |
| 54 | |
| 55 | - uses: r-lib/actions/setup-pandoc@v1 |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 56 | if: matrix.config.pandoc != 'devel' |
| 57 | with: |
| 58 | pandoc-version: ${{ matrix.config.pandoc }} |
| 59 | |
| 60 | - uses: cderv/actions/setup-pandoc-nightly@nightly-pandoc |
| 61 | if: matrix.config.pandoc == 'devel' |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 62 | |
| 63 | - uses: r-lib/actions/setup-r@v1 |
| 64 | with: |
| 65 | r-version: ${{ matrix.config.r }} |
| 66 | http-user-agent: ${{ matrix.config.http-user-agent }} |
| 67 | use-public-rspm: true |
| 68 | |
| 69 | - uses: r-lib/actions/setup-r-dependencies@v1 |
| 70 | with: |
| 71 | extra-packages: rcmdcheck |
| 72 | |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 73 | - uses: r-lib/actions/check-r-package@master |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 74 | |
| 75 | - name: Show testthat output |
| 76 | if: always() |
| 77 | run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true |
| 78 | shell: bash |
| 79 | |
| 80 | - name: Upload check results |
| 81 | if: failure() |
| 82 | uses: actions/upload-artifact@main |
| 83 | with: |
| 84 | name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 85 | path: check |
Christophe Dervieux | 7f1add5 | 2021-09-15 15:42:07 +0200 | [diff] [blame] | 86 | |
| 87 | - name: Test coverage |
| 88 | if: success() && runner.os == 'Linux' && matrix.config.r == 'release' && matrix.config.pandoc == '2.11.4' |
| 89 | run: | |
| 90 | pak::pkg_install('covr') |
| 91 | covr::codecov() |
| 92 | shell: Rscript {0} |