blob: 0fdc22d9e4d0cd852a7f3a012681c4e6f03f0bc4 [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]
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
33 - {os: macOS-latest, pandoc: '2.11.4', r: 'release'}
34 - {os: macOS-latest, pandoc: '2.14.2', r: 'release'}
christophe dervieux76d730d2021-09-15 15:02:02 +020035
Christophe Dervieux21239cf2021-09-15 15:34:01 +020036 # TODO: issue on windows with pandoc 2.11.4 - change when fixed
37 - {os: windows-latest, pandoc: '2.7.3', r: 'release'}
christophe dervieux76d730d2021-09-15 15:02:02 +020038 # Use 3.6 to trigger usage of RTools35
Christophe Dervieux21239cf2021-09-15 15:34:01 +020039 - {os: windows-latest, pandoc: '2.7.3', r: '3.6'}
christophe dervieux76d730d2021-09-15 15:02:02 +020040
41 # Use older ubuntu to maximise backward compatibility
Christophe Dervieux21239cf2021-09-15 15:34:01 +020042 - {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 dervieux76d730d2021-09-15 15:02:02 +020047
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 Dervieux21239cf2021-09-15 15:34:01 +020056 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 dervieux76d730d2021-09-15 15:02:02 +020062
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 Dervieux21239cf2021-09-15 15:34:01 +020073 - uses: r-lib/actions/check-r-package@master
christophe dervieux76d730d2021-09-15 15:02:02 +020074
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 Dervieux7f1add52021-09-15 15:42:07 +020086
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}