-
Notifications
You must be signed in to change notification settings - Fork 991
161 lines (140 loc) · 5.79 KB
/
R-CMD-check-occasional.yaml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
on:
schedule:
- cron: '17 13 12 * *' # 12th of month at 13:17 UTC
# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release
name: R-CMD-check-occasional
jobs:
R-CMD-check-occasional:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (${{ matrix.r }})
strategy:
fail-fast: false
matrix:
os: [macOS-latest, windows-latest, ubuntu-latest]
r: ['devel', 'release', '3.3', '3.4', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3']
locale: ['en_US.utf8', 'zh_CN.utf8', 'lv_LV.utf8'] # Chinese for translations, Latvian for collate order (#3502)
exclude:
# only run non-English locale CI on Ubuntu
- os: macOS-latest
locale: 'zh_CN.utf8'
- os: macOS-latest
locale: 'lv_LV.utf8'
- os: windows-latest
locale: 'zh_CN.utf8'
- os: windows-latest
locale: 'lv_LV.utf8'
# macOS/arm64 only available for R>=4.1.0
- os: macOS-latest
r: '3.3'
- os: macOS-latest
r: '3.4'
- os: macOS-latest
r: '3.5'
- os: macOS-latest
r: '3.6'
- os: macOS-latest
r: '4.0'
- os: macOS-latest
r: '4.1'
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Set locale
if: matrix.os == 'ubuntu-latest' && matrix.locale == 'en_US.utf8'
run: |
sudo locale-gen en_US
echo "LC_ALL=en_US.utf8" >> $GITHUB_ENV
- name: Set locale
if: matrix.locale == 'zh_CN.utf8'
run: |
sudo locale-gen 'zh_CN.utf8'
echo "LC_ALL=zh_CN.utf8" >> $GITHUB_ENV
echo "LANGUAGE=zh_CN" >> $GITHUB_ENV
- name: Set locale
if: matrix.locale == 'lv_LV.utf8'
run: |
sudo locale-gen 'lv_LV.utf8'
echo "LC_ALL=lv_LV.utf8" >> $GITHUB_ENV
echo "LANGUAGE=lv_LV" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r }}
- name: Install check dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev
- name: Install check dependencies (macOS)
if: matrix.os == 'macOS-latest'
run: brew install gdal proj
- name: Install remotes
run: install.packages("remotes")
shell: Rscript {0}
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies=TRUE, force=TRUE)
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs <- get(as.character(other_deps_expr[[1L]][[2L]]))
# May not install on oldest R versions
try(remotes::install_cran(c(pkgs, "rcmdcheck"), force=TRUE))
shell: Rscript {0}
- name: Check
env:
# several Suggests dependencies have R dependencies more recent than ours
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_TESTS_NLINES_: 0
run: |
options(crayon.enabled = TRUE)
# we define this in data.table namespace, but it appears to be exec
if (!exists("isFALSE", "package:base")) {
if (!exists("isFALSE", asNamespace("data.table"))) {
cat("isFALSE not found in base, but data.table did not define it either!\n")
}
# attempt defining it here as a workaround...
isFALSE = function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x
}
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs = get(as.character(other_deps_expr[[1L]][[2L]]))
has_pkg = sapply(pkgs, requireNamespace, quietly=TRUE)
run_other = all(has_pkg)
if (!run_other) {
cat(sprintf("Skipping other.Rraw since some required packages are not available: %s\n", toString(pkgs[!has_pkg])))
}
Sys.setenv(TEST_DATA_TABLE_WITH_OTHER_PACKAGES=as.character(run_other))
do_vignettes <- requireNamespace("knitr", quietly=TRUE)
vignette_args <- if (!do_vignettes) "--no-build-vignettes"
args <- c("--no-manual", "--as-cran", vignette_args)
if (requireNamespace("rcmdcheck", quietly=TRUE)) {
rcmdcheck::rcmdcheck(args = args, error_on = "warning", check_dir = "check")
} else {
Rbin = if (.Platform$OS.type == "windows") "R.exe" else "R"
system2(Rbin, c("CMD", "build", ".", vignette_args))
dt_tar <- list.files(pattern = "^data[.]table_.*[.]tar[.]gz$")
if (!length(dt_tar)) stop("Built tar.gz not found among: ", toString(list.files()))
# --no-build-vignettes is not enough for R CMD check
if (!do_vignettes) args <- c(args, "--ignore-vignettes")
res = system2(Rbin, c("CMD", "check", dt_tar[1L], args), stdout=TRUE)
if (!is.null(attr(res, "status")) || grep("^Status:.*(ERROR|WARNING)", res)) {
writeLines(res)
stop("R CMD check failed")
}
}
shell: Rscript {0}
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.r }}-results
path: check