Unverified Commit 5a678f6a authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] Add debian-clang-devel CI job for the R package (#4164)



* [ci] Add debian-clang-devel CI job for the R package

* [ci] Add debian-clang-devel CI job for the R package

* fixes

* fix test

* update cran-comments

* re-trigger CI

* catch warnings and notes

* fail with only a NOTE

* uncomment CI code

* remove env vars in windows tests

* Update R-package/cran-comments.md
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
Co-authored-by: default avatarStrikerRUS <nekit94-12@hotmail.com>
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 9e1d7fa1
...@@ -7,19 +7,6 @@ mkdir -p $R_LIB_PATH ...@@ -7,19 +7,6 @@ mkdir -p $R_LIB_PATH
export R_LIBS=$R_LIB_PATH export R_LIBS=$R_LIB_PATH
export PATH="$R_LIB_PATH/R/bin:$PATH" export PATH="$R_LIB_PATH/R/bin:$PATH"
# hack to get around this:
# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html
export _R_CHECK_SYSTEM_CLOCK_=0
# ignore R CMD CHECK NOTE checking how long it has
# been since the last submission
export _R_CHECK_CRAN_INCOMING_REMOTE_=0
# CRAN ignores the "installed size is too large" NOTE,
# so our CI can too. Setting to a large value here just
# to catch extreme problems
export _R_CHECK_PKG_SIZES_THRESHOLD_=100
# don't fail builds for long-running examples unless they're very long. # don't fail builds for long-running examples unless they're very long.
# See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. # See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254.
if [[ $R_BUILD_TYPE != "cran" ]]; then if [[ $R_BUILD_TYPE != "cran" ]]; then
......
...@@ -79,19 +79,6 @@ $env:CRAN_MIRROR = "https://cloud.r-project.org/" ...@@ -79,19 +79,6 @@ $env:CRAN_MIRROR = "https://cloud.r-project.org/"
$env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex" $env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex"
$env:CTAN_PACKAGE_ARCHIVE = "$env:CTAN_MIRROR/tm/packages/" $env:CTAN_PACKAGE_ARCHIVE = "$env:CTAN_MIRROR/tm/packages/"
# hack to get around this:
# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html
$env:_R_CHECK_SYSTEM_CLOCK_ = 0
# ignore R CMD CHECK NOTE checking how long it has
# been since the last submission
$env:_R_CHECK_CRAN_INCOMING_REMOTE_ = 0
# CRAN ignores the "installed size is too large" NOTE,
# so our CI can too. Setting to a large value here just
# to catch extreme problems
$env:_R_CHECK_PKG_SIZES_THRESHOLD_ = 100
# don't fail builds for long-running examples unless they're very long. # don't fail builds for long-running examples unless they're very long.
# See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. # See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254.
if ($env:R_BUILD_TYPE -ne "cran") { if ($env:R_BUILD_TYPE -ne "cran") {
......
...@@ -8,6 +8,18 @@ on: ...@@ -8,6 +8,18 @@ on:
branches: branches:
- master - master
env:
# hack to get around this:
# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html
_R_CHECK_SYSTEM_CLOCK_: 0
# ignore R CMD CHECK NOTE checking how long it has
# been since the last submission
_R_CHECK_CRAN_INCOMING_REMOTE_: 0
# CRAN ignores the "installed size is too large" NOTE,
# so our CI can too. Setting to a large value here just
# to catch extreme problems
_R_CHECK_PKG_SIZES_THRESHOLD_: 100
jobs: jobs:
test: test:
name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }}) name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }})
...@@ -181,10 +193,37 @@ jobs: ...@@ -181,10 +193,37 @@ jobs:
Rscriptdevel testthat.R 2>&1 > ubsan-tests.log Rscriptdevel testthat.R 2>&1 > ubsan-tests.log
cat ubsan-tests.log cat ubsan-tests.log
exit $(cat ubsan-tests.log | grep --count "runtime error") exit $(cat ubsan-tests.log | grep --count "runtime error")
test-r-debian-clang:
name: r-package (debian, R-devel, clang)
timeout-minutes: 60
runs-on: ubuntu-latest
container: rhub/debian-clang-devel
steps:
- name: Install Git before checkout
shell: bash
run: |
apt-get update
apt-get install --no-install-recommends -y git
- name: Checkout repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 5
submodules: true
- name: Install packages and run tests
shell: bash
run: |
export PATH=/opt/R-devel/bin/:${PATH}
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'testthat'), repos = 'https://cran.r-project.org')"
sh build-cran-package.sh
R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit -1
if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then
echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check"
exit -1
fi
all-successful: all-successful:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test, test-r-sanitizers] needs: [test, test-r-sanitizers, test-r-debian-clang]
steps: steps:
- name: Note that all tests succeeded - name: Note that all tests succeeded
run: echo "🎉" run: echo "🎉"
# CRAN Submission History # CRAN Submission History
## v3.2.0 - Submission 1 - (TBD) ## v3.2.1 - Submission 1 - (TBD)
### CRAN response ### CRAN response
### Maintainer Notes ### Maintainer Notes
## v3.2.0 - Submission 1 - (March 22, 2021)
### CRAN response
Package is failing checks in the `r-devel-linux-x86_64-debian-clang` environment (described [here](https://cran.r-project.org/web/checks/check_flavors.html#r-devel-linux-x86_64-debian-clang)). Specifically, one unit test on the use of non-ASCII feature names in `Booster$dump_model()` fails.
> Apparently your package fails its checks in a strict Latin-1* locale,
e.g. under Linux using LANG=en_US.iso88591 (see the debian-clang
results).
> Please correct before 2021-04-21 to safely retain your package on CRAN.
### Maintainer Notes
Submitted a version 3.2.1 to correct the errors noted.
## v3.1.1 - Submission 1 - (December 7, 2020) ## v3.1.1 - Submission 1 - (December 7, 2020)
### CRAN response ### CRAN response
......
...@@ -2,6 +2,11 @@ context("lightgbm()") ...@@ -2,6 +2,11 @@ context("lightgbm()")
ON_WINDOWS <- .Platform$OS.type == "windows" ON_WINDOWS <- .Platform$OS.type == "windows"
UTF8_LOCALE <- all(grepl(
pattern = "UTF-8$"
, x = Sys.getlocale(category = "LC_CTYPE")
))
data(agaricus.train, package = "lightgbm") data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm") data(agaricus.test, package = "lightgbm")
train <- agaricus.train train <- agaricus.train
...@@ -1229,7 +1234,7 @@ test_that("lgb.train() supports non-ASCII feature names", { ...@@ -1229,7 +1234,7 @@ test_that("lgb.train() supports non-ASCII feature names", {
# UTF-8 strings are not well-supported on Windows # UTF-8 strings are not well-supported on Windows
# * https://developer.r-project.org/Blog/public/2020/05/02/utf-8-support-on-windows/ # * https://developer.r-project.org/Blog/public/2020/05/02/utf-8-support-on-windows/
# * https://developer.r-project.org/Blog/public/2020/07/30/windows/utf-8-build-of-r-and-cran-packages/index.html # * https://developer.r-project.org/Blog/public/2020/07/30/windows/utf-8-build-of-r-and-cran-packages/index.html
if (!ON_WINDOWS) { if (UTF8_LOCALE && !ON_WINDOWS) {
expect_identical( expect_identical(
dumped_model[["feature_names"]] dumped_model[["feature_names"]]
, feature_names , feature_names
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment