Skip to content

[ci] [R-package] re-enable 'rchk' checks #6713

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

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Changes from all 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
27 changes: 26 additions & 1 deletion .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ jobs:
- clang19
- gcc14
- intel
- rchk
runs-on: ubuntu-latest
container: ghcr.io/r-hub/containers/${{ matrix.image }}:latest
steps:
Expand Down Expand Up @@ -311,8 +312,32 @@ jobs:
- name: Install packages and run tests
shell: bash
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh

# 'rchk' isn't run through 'R CMD check', use the approach documented at
# https://r-hub.github.io/containers/local.html
if [[ "${{ matrix.image }}" =~ "rchk" ]]; then
r-check "$(pwd)" \
| tee ./rchk-logs.txt 2>&1

# the '-v' exceptions below are from R/rchk itself and not LightGBM:
# https://github.com/kalibera/rchk/issues/22#issuecomment-656036156
if grep -E '\[PB\]|ERROR' ./rchk-logs.txt \
| grep -v 'too many states' \
> /dev/null; \
then
echo "rchk found issues"
exit 1
else
echo "rchk did not find any issues"
exit 0
fi
fi

# 'testthat' is not needed by 'rchk', so avoid installing it until here
Rscript -e "install.packages('testthat', repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"

if [[ "${{ matrix.image }}" =~ "clang" ]]; then
# allowing the following NOTEs (produced by default in the clang images):
#
Expand Down
Loading