-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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] [R-package] add CI jobs covering more CRAN "additional checks", fix R_NO_REMAP warnings (fixes #6369) #6523
Merged
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0fa57ec
[ci] [R-package] add CI jobs testing newer compilers
jameslamb a034ac1
set up vignette-processing dependencies
jameslamb 599f457
remove tinytex
jameslamb f07d4bd
set up pandoc
jameslamb 71ee55a
allow NOTEs, one more R_NO_REMAP guard
jameslamb 2e09819
Merge branch 'master' into ci/gcc14-job
jameslamb e4594ce
restore other CI
jameslamb e126e23
one more R_NO_REMAP guard
jameslamb 2c846aa
Merge branch 'master' into ci/gcc14-job
jameslamb 31a1e7c
fail builds producing more than 1 NOTE
jameslamb b966cc7
Merge branch 'master' into ci/gcc14-job
jameslamb e011fc3
Merge branch 'master' into ci/gcc14-job
jameslamb 8d59c8e
update approach for running R CMD check
jameslamb 76af41d
fix filepath
jameslamb b5683b6
fix paths
jameslamb 49a6f84
fix variable name
jameslamb 2c9f9cb
echo lines
jameslamb 61ca2eb
fix piping
jameslamb a1448c1
fix file extension
jameslamb 4fe1771
clean up
jameslamb 05794c9
Merge branch 'master' into ci/gcc14-job
jameslamb f8cfe74
make R CMD check stricter
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
set -e -u -o pipefail | ||
|
||
PKG_TARBALL="${1}" | ||
declare -i ALLOWED_CHECK_NOTES=${2} | ||
|
||
# 'R CMD check' redirects installation logs to a file, and returns | ||
# a non-0 exit code if ERRORs are raised. | ||
# | ||
# The '||' here gives us an opportunity to echo out the installation | ||
# logs prior to exiting the script. | ||
check_succeeded="yes" | ||
R CMD check "${PKG_TARBALL}" \ | ||
--as-cran \ | ||
--run-donttest \ | ||
|| check_succeeded="no" | ||
|
||
CHECK_LOG_FILE=lightgbm.Rcheck/00check.log | ||
BUILD_LOG_FILE=lightgbm.Rcheck/00install.out | ||
|
||
echo "R CMD check build logs:" | ||
cat "${BUILD_LOG_FILE}" | ||
|
||
if [[ $check_succeeded == "no" ]]; then | ||
echo "R CMD check failed" | ||
exit 1 | ||
fi | ||
|
||
# WARNINGs or ERRORs should be treated as a failure | ||
if grep -q -E "WARNING|ERROR" "${CHECK_LOG_FILE}"; then | ||
echo "WARNINGs or ERRORs have been found by R CMD check" | ||
exit 1 | ||
fi | ||
|
||
# Allow a configurable number of NOTEs. | ||
# Sometimes NOTEs are raised in CI that wouldn't show up on an actual CRAN submission. | ||
set +e | ||
NUM_CHECK_NOTES=$( | ||
grep -o -E '[0-9]+ NOTE' "${CHECK_LOG_FILE}" \ | ||
| sed 's/[^0-9]*//g' | ||
) | ||
if [[ ${NUM_CHECK_NOTES} -gt ${ALLOWED_CHECK_NOTES} ]]; then | ||
echo "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,12 @@ env: | |
# | ||
# this could be removed (hopefully) when R 3.6 support is removed | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
# in CMake-driven builds, parallelize compilation | ||
CMAKE_BUILD_PARALLEL_LEVEL: 4 | ||
# on Debian-based images, avoid interactive prompts | ||
DEBIAN_FRONTEND: noninteractive | ||
# parallelize compilation (extra important for Linux, where CRAN doesn't supply pre-compiled binaries) | ||
MAKEFLAGS: "-j4" | ||
# hack to get around this: | ||
# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html | ||
_R_CHECK_SYSTEM_CLOCK_: 0 | ||
|
@@ -258,58 +263,78 @@ jobs: | |
RDscript${{ matrix.r_customization }} testthat.R >> tests.log 2>&1 || exit_code=-1 | ||
cat ./tests.log | ||
exit ${exit_code} | ||
test-r-debian-clang: | ||
name: r-package (debian, R-devel, clang-${{ matrix.clang-version }}) | ||
test-r-extra-checks: | ||
name: r-package (${{ matrix.image }}, R-devel) | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# list of versions tested in CRAN "Additional Checks": | ||
# https://cran.r-project.org/web/checks/check_issue_kinds.html | ||
clang-version: | ||
- 16 | ||
- 17 | ||
# references: | ||
# * CRAN "additional checks": https://cran.r-project.org/web/checks/check_issue_kinds.html | ||
# * images: https://r-hub.github.io/containers/containers.html | ||
image: | ||
- clang16 | ||
- clang17 | ||
- clang18 | ||
- clang19 | ||
- gcc14 | ||
- intel | ||
runs-on: ubuntu-latest | ||
container: rhub/debian-clang-devel | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
container: ghcr.io/r-hub/containers/${{ matrix.image }}:latest | ||
steps: | ||
- name: Install Git before checkout | ||
shell: bash | ||
run: | | ||
apt-get update --allow-releaseinfo-change | ||
apt-get install --no-install-recommends -y git | ||
- name: Trust git cloning LightGBM | ||
run: | | ||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
- name: install clang | ||
- name: Install pandoc | ||
uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install LaTeX | ||
shell: bash | ||
run: | | ||
./.ci/install-clang-devel.sh ${{ matrix.clang-version }} | ||
if type -f apt 2>&1 > /dev/null; then | ||
apt-get update | ||
apt-get install --no-install-recommends -y \ | ||
devscripts \ | ||
texinfo \ | ||
texlive-latex-extra \ | ||
texlive-latex-recommended \ | ||
texlive-fonts-recommended \ | ||
texlive-fonts-extra \ | ||
tidy \ | ||
qpdf | ||
else | ||
yum update -y | ||
yum install -y \ | ||
devscripts \ | ||
qpdf \ | ||
texinfo \ | ||
texinfo-tex \ | ||
texlive-latex \ | ||
tidy | ||
fi | ||
- 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', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" | ||
sh build-cran-package.sh | ||
R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit 1 | ||
echo "" | ||
echo "install logs:" | ||
echo "" | ||
cat lightgbm.Rcheck/00install.out | ||
echo "" | ||
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 | ||
# allowing the following NOTEs (produced by default in the clang images): | ||
# | ||
# * checking compilation flags used ... NOTE | ||
# Compilation used the following non-portable flag(s): | ||
# ‘-Wp,-D_FORTIFY_SOURCE=3’ | ||
# | ||
# even though CRAN itself sets that: | ||
# https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang | ||
# | ||
declare -i allowed_notes=1 | ||
StrikerRUS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bash .ci/run-r-cmd-check.sh \ | ||
"$(echo lightgbm_*.tar.gz)" \ | ||
StrikerRUS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"${allowed_notes}" | ||
all-r-package-jobs-successful: | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: [test, test-r-sanitizers, test-r-debian-clang] | ||
needs: [test, test-r-sanitizers, test-r-extra-checks] | ||
steps: | ||
- name: Note that all tests succeeded | ||
uses: re-actors/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a fix found in #6501. That PR was abandoned accidentally and I'd still like to give @Kunal-Singh-Dadhwal an opportunity to submit that work again.
But I want this particular fix, to get more confidence that the R CI jobs are working as expected.
context: #6501 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jameslamb Thanks for the opportunity will make a commit really soon