-
Notifications
You must be signed in to change notification settings - Fork 3
135 lines (115 loc) · 4.06 KB
/
check-r.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
on:
push:
paths:
- 'r/**/*'
- .github/workflows/check-r.yml
pull_request:
paths:
- 'r/**/*'
- .github/workflows/check-r.yml
name: "R checks"
jobs:
check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"
timeout-minutes: 10
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'devel' }
- {os: windows-latest, r: 'release' }
- {os: windows-latest, r: 'oldrel' }
# - {os: macOS-latest, r: 'devel' }
- {os: macOS-latest, r: 'release' }
# - {os: macOS-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: 'devel' }
- {os: ubuntu-latest, r: 'release' }
- {os: ubuntu-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: '3.6' }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
_R_CHECK_MATRIX_DATA_: true
_R_CHECK_SUGGESTS_ONLY_: true
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y tidy
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: r
extra-packages: any::rcmdcheck any::covr any::jsonlite
needs: check coverage
- name: Install port4me
run: |
cd r/
Rscript -e "install.packages('.', repos = NULL, type = 'source')"
- name: Session info
run: |
options(width = 100)
capabilities()
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Check
if: runner.os != 'Windows'
run: |
rcmdcheck::rcmdcheck(
path = "r",
args = "--as-cran",
error_on = "note",
check_dir = "check"
)
shell: Rscript {0}
- name: Check (MS Windows)
if: runner.os == 'Windows'
run: |
rcmdcheck::rcmdcheck(
path = "r",
args = c("--no-manual", "--as-cran"),
error_on = "note",
check_dir = "check"
)
shell: Rscript {0}
- name: Check CLI
if: runner.os != 'Windows'
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.10.0.tar.gz && tar xf v1.10.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.1.0.tar.gz && tar xf v2.1.0.tar.gz
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.1.0
export PATH=$PWD/bats-core-1.10.0/bin:$PATH
bash --version
bats --version
cd r/
make check-cli
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: Test coverage
if: matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'release'
run: |
setwd("r")
## relative_path = ".." => reported files r/R/*.R, r/src/*.{c,h}
coverage <- covr::package_coverage(relative_path = "..", quiet = FALSE)
print(coverage)
covr::codecov(coverage = coverage, flags = "r", quiet = FALSE) ## Upload to codecov
shell: Rscript {0}