Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 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 |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 33 | - {os: windows-latest, pandoc: '3.1.1', r: 'release'} |
| 34 | - {os: macOS-latest, pandoc: '3.1.1', r: 'release'} |
| 35 | - {os: ubuntu-latest, pandoc: 'devel', r: 'release'} |
| 36 | # testing older pandoc versions |
| 37 | - {os: ubuntu-latest, pandoc: '2.19.2', r: 'release'} |
| 38 | - {os: ubuntu-latest, pandoc: '2.18', r: 'release'} |
| 39 | - {os: ubuntu-latest, pandoc: '2.17.1.1', r: 'release'} |
| 40 | - {os: ubuntu-latest, pandoc: '2.16.2', r: 'release'} |
| 41 | - {os: ubuntu-latest, pandoc: '2.14.2', r: 'release'} |
| 42 | - {os: ubuntu-latest, pandoc: '2.11.4', r: 'release'} |
| 43 | - {os: ubuntu-latest, pandoc: '2.7.3', r: 'release'} |
| 44 | - {os: ubuntu-latest, pandoc: '2.5', r: 'release'} |
| 45 | # testing other R versions |
| 46 | - {os: ubuntu-latest, pandoc: '2.11.4', r: 'devel', http-user-agent: 'release'} |
| 47 | - {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-1'} |
| 48 | - {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-2'} |
| 49 | - {os: ubuntu-latest, pandoc: '2.11.4', r: 'oldrel-3'} |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 50 | env: |
| 51 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 52 | R_KEEP_PKG_SOURCE: yes |
| 53 | |
| 54 | steps: |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 55 | - uses: actions/checkout@v3 |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 56 | |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 57 | - uses: r-lib/actions/setup-pandoc@v2 |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 58 | |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 59 | - uses: r-lib/actions/setup-r@v2 |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 60 | with: |
| 61 | r-version: ${{ matrix.config.r }} |
| 62 | http-user-agent: ${{ matrix.config.http-user-agent }} |
| 63 | use-public-rspm: true |
| 64 | |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 65 | - uses: r-lib/actions/setup-r-dependencies@v2 |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 66 | with: |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 67 | extra-packages: any::rcmdcheck |
| 68 | needs: check |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 69 | |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 70 | - name: Remove default installed Pandoc |
| 71 | if: runner.os == 'Linux' |
| 72 | run: sudo dpkg -r pandoc |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 73 | |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 74 | - uses: r-lib/actions/setup-pandoc@v2 |
| 75 | if: matrix.config.pandoc != 'devel' |
christophe dervieux | 76d730d | 2021-09-15 15:02:02 +0200 | [diff] [blame] | 76 | with: |
Christophe Dervieux | 7d613ee | 2023-03-24 17:35:02 +0100 | [diff] [blame] | 77 | pandoc-version: ${{ matrix.config.pandoc }} |
| 78 | |
| 79 | - uses: cderv/actions/setup-pandoc-nightly@nightly-pandoc |
| 80 | if: matrix.config.pandoc == 'devel' |
| 81 | |
| 82 | - uses: r-lib/actions/check-r-package@v2 |
| 83 | with: |
| 84 | upload-snapshots: true |