blob: f2f400f6f3e377c123d340889f06c1d384a81fb4 [file] [log] [blame]
christophe dervieux76d730d2021-09-15 15:02:02 +02001# 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.
7on:
8 push:
9 branches: [main, master]
10 pull_request:
11 branches: [main, master]
12
13name: R-CMD-check
14
15jobs:
16 R-CMD-check:
17 runs-on: ${{ matrix.config.os }}
18
Christophe Dervieux21239cf2021-09-15 15:34:01 +020019 name: ${{ matrix.config.os }} (${{ matrix.config.r }}) [Pandoc ${{ matrix.config.pandoc }}]
christophe dervieux76d730d2021-09-15 15:02:02 +020020
21 strategy:
22 fail-fast: false
23 matrix:
24 config:
Christophe Dervieux21239cf2021-09-15 15:34:01 +020025 # testing R release with last shipped pandoc version in RStudio IDE and new pandoc
26 - {os: macOS-latest, pandoc: '2.11.4', r: 'release'}
27 - {os: macOS-latest, pandoc: '2.14.2', r: 'release'}
christophe dervieux76d730d2021-09-15 15:02:02 +020028
Christophe Dervieux21239cf2021-09-15 15:34:01 +020029 # TODO: issue on windows with pandoc 2.11.4 - change when fixed
30 - {os: windows-latest, pandoc: '2.7.3', r: 'release'}
christophe dervieux76d730d2021-09-15 15:02:02 +020031 # Use 3.6 to trigger usage of RTools35
Christophe Dervieux21239cf2021-09-15 15:34:01 +020032 - {os: windows-latest, pandoc: '2.7.3', r: '3.6'}
christophe dervieux76d730d2021-09-15 15:02:02 +020033
34 # Use older ubuntu to maximise backward compatibility
Christophe Dervieux21239cf2021-09-15 15:34:01 +020035 - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'devel', http-user-agent: 'release'}
36 - {os: ubuntu-18.04, pandoc: 'devel', r: 'release'}
37 - {os: ubuntu-18.04, pandoc: '2.14.2', r: 'release'}
38 - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'release'}
39 - {os: ubuntu-18.04, pandoc: '2.11.4', r: 'oldrel-1'}
christophe dervieux76d730d2021-09-15 15:02:02 +020040
41 env:
42 GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
43 R_KEEP_PKG_SOURCE: yes
44
45 steps:
46 - uses: actions/checkout@v2
47
48 - uses: r-lib/actions/setup-pandoc@v1
Christophe Dervieux21239cf2021-09-15 15:34:01 +020049 if: matrix.config.pandoc != 'devel'
50 with:
51 pandoc-version: ${{ matrix.config.pandoc }}
52
53 - uses: cderv/actions/setup-pandoc-nightly@nightly-pandoc
54 if: matrix.config.pandoc == 'devel'
christophe dervieux76d730d2021-09-15 15:02:02 +020055
56 - uses: r-lib/actions/setup-r@v1
57 with:
58 r-version: ${{ matrix.config.r }}
59 http-user-agent: ${{ matrix.config.http-user-agent }}
60 use-public-rspm: true
61
62 - uses: r-lib/actions/setup-r-dependencies@v1
63 with:
64 extra-packages: rcmdcheck
65
Christophe Dervieux21239cf2021-09-15 15:34:01 +020066 - uses: r-lib/actions/check-r-package@master
christophe dervieux76d730d2021-09-15 15:02:02 +020067
68 - name: Show testthat output
69 if: always()
70 run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
71 shell: bash
72
73 - name: Upload check results
74 if: failure()
75 uses: actions/upload-artifact@main
76 with:
77 name: ${{ runner.os }}-r${{ matrix.config.r }}-results
78 path: check