Skip to content

Commit 681a920

Browse files
GitHub Actions: enable
1 parent f62c6c3 commit 681a920

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#----------------------------
44
^.svn
55
^.git
6+
^.github
67
^.make
78
^INSTALL[.]md$
89
^OVERVIEW[.]md$

.github/workflows/R-CMD-check.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
on: [push, pull_request]
2+
3+
name: R-CMD-check
4+
5+
jobs:
6+
R-CMD-check:
7+
runs-on: ${{ matrix.config.os }}
8+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
9+
if: "! contains(github.event.head_commit.message, '[ci skip]')"
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
config:
15+
- { os: windows-latest, r: '3.5'}
16+
- { os: windows-latest, r: '3.6'}
17+
- { os: windows-latest, r: 'devel'}
18+
- { os: macOS-latest, r: '3.5'}
19+
- { os: macOS-latest, r: '3.6'}
20+
- { os: macOS-latest, r: 'devel'}
21+
- { os: ubuntu-16.04, r: '3.2', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
22+
- { os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
23+
- { os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
24+
- { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
25+
- { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
26+
27+
env:
28+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
29+
CRAN: ${{ matrix.config.cran }}
30+
31+
32+
steps:
33+
- uses: actions/checkout@v1
34+
35+
- uses: r-lib/actions/setup-r@master
36+
with:
37+
r-version: ${{ matrix.config.r }}
38+
39+
- uses: r-lib/actions/setup-pandoc@master
40+
41+
- name: Query dependencies
42+
run: Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds', version = 2)"
43+
44+
- name: Cache R packages
45+
if: runner.os != 'Windows'
46+
uses: actions/cache@v1
47+
with:
48+
path: ${{ env.R_LIBS_USER }}
49+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
50+
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-
51+
52+
- name: Install system dependencies
53+
if: runner.os == 'Linux'
54+
env:
55+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
56+
run: |
57+
Rscript -e "remotes::install_github('r-hub/sysreqs')"
58+
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
59+
sudo -s eval "$sysreqs"
60+
61+
- name: Install dependencies
62+
run: Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')"
63+
64+
- name: Check
65+
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"
66+
67+
- name: Upload check results
68+
if: failure()
69+
uses: actions/upload-artifact@master
70+
with:
71+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
72+
path: check
73+
74+
- name: Test coverage
75+
if: matrix.config.os == 'ubuntu-16.04' && matrix.config.r == '3.6-9000'
76+
run: |
77+
Rscript -e "install.packages('covr')" -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'

0 commit comments

Comments
 (0)