Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 15 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,33 @@ jobs:
Rscriptdevel testthat.R 2>&1 > ubsan-tests.log
cat ubsan-tests.log
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
all-successful:
# https://github.saobby.my.eu.orgmunity/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: [test, test-r-sanitizers]
needs: [test, test-r-sanitizers, test-r-debian-clang]
steps:
- name: Note that all tests succeeded
run: echo "🎉"
18 changes: 17 additions & 1 deletion R-package/cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# CRAN Submission History

## v3.2.0 - Submission 1 - (TBD)
## v3.2.1 - Submission 1 - (TBD)

### CRAN response

### 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)

### CRAN response
Expand Down
7 changes: 6 additions & 1 deletion R-package/tests/testthat/test_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ context("lightgbm()")

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.test, package = "lightgbm")
train <- agaricus.train
Expand Down Expand Up @@ -1229,7 +1234,7 @@ test_that("lgb.train() supports non-ASCII feature names", {
# 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/07/30/windows/utf-8-build-of-r-and-cran-packages/index.html
if (!ON_WINDOWS) {
if (UTF8_LOCALE && !ON_WINDOWS) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

expect_identical(
dumped_model[["feature_names"]]
, feature_names
Expand Down