blob: 5065b4c06c40ffc2890f2da0397e43c33d1c7213 [file] [log] [blame]
Christophe Dervieux7d613ee2023-03-24 17:35:02 +01001# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
christophe dervieux76d730d2021-09-15 15:02:02 +02002# 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.
7on:
8 push:
9 branches: [main, master]
Christophe Dervieux7f1add52021-09-15 15:42:07 +020010 paths-ignore:
11 - 'pkgdown/**'
12 - '.github/workflows/pkgdown.yaml'
christophe dervieux76d730d2021-09-15 15:02:02 +020013 pull_request:
14 branches: [main, master]
christophe dervieux66ea6662021-09-15 15:49:12 +020015 paths-ignore:
Christophe Dervieux7f1add52021-09-15 15:42:07 +020016 - 'pkgdown/**'
17 - '.github/workflows/pkgdown.yaml'
18
christophe dervieux76d730d2021-09-15 15:02:02 +020019
20name: R-CMD-check
21
22jobs:
23 R-CMD-check:
24 runs-on: ${{ matrix.config.os }}
25
Christophe Dervieux21239cf2021-09-15 15:34:01 +020026 name: ${{ matrix.config.os }} (${{ matrix.config.r }}) [Pandoc ${{ matrix.config.pandoc }}]
christophe dervieux76d730d2021-09-15 15:02:02 +020027
28 strategy:
29 fail-fast: false
30 matrix:
31 config:
Christophe Dervieux21239cf2021-09-15 15:34:01 +020032 # testing R release with last shipped pandoc version in RStudio IDE and new pandoc
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010033 - {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 dervieux76d730d2021-09-15 15:02:02 +020050 env:
51 GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
52 R_KEEP_PKG_SOURCE: yes
53
54 steps:
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010055 - uses: actions/checkout@v3
christophe dervieux76d730d2021-09-15 15:02:02 +020056
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010057 - uses: r-lib/actions/setup-pandoc@v2
christophe dervieux76d730d2021-09-15 15:02:02 +020058
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010059 - uses: r-lib/actions/setup-r@v2
christophe dervieux76d730d2021-09-15 15:02:02 +020060 with:
61 r-version: ${{ matrix.config.r }}
62 http-user-agent: ${{ matrix.config.http-user-agent }}
63 use-public-rspm: true
64
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010065 - uses: r-lib/actions/setup-r-dependencies@v2
christophe dervieux76d730d2021-09-15 15:02:02 +020066 with:
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010067 extra-packages: any::rcmdcheck
68 needs: check
christophe dervieux76d730d2021-09-15 15:02:02 +020069
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010070 - name: Remove default installed Pandoc
71 if: runner.os == 'Linux'
72 run: sudo dpkg -r pandoc
christophe dervieux76d730d2021-09-15 15:02:02 +020073
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010074 - uses: r-lib/actions/setup-pandoc@v2
75 if: matrix.config.pandoc != 'devel'
christophe dervieux76d730d2021-09-15 15:02:02 +020076 with:
Christophe Dervieux7d613ee2023-03-24 17:35:02 +010077 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