4242 - uses : r-lib/actions/setup-r@v2
4343 with :
4444 r-version : ${{ matrix.r }}
45- - name : Cache R packages
46- uses : actions/cache@v4
47- with :
48- path : ${{ env.R_LIBS_USER }}
49- key : ${{ runner.os }}-r-${{ matrix.r }}-8-${{ hashFiles('R-package/DESCRIPTION') }}
50- restore-keys : ${{ runner.os }}-r-${{ matrix.r }}-8-${{ hashFiles('R-package/DESCRIPTION') }}
5145 - uses : actions/setup-python@v5
5246 with :
5347 python-version : " 3.10"
@@ -70,13 +64,12 @@ jobs:
7064 name : Test R package on Debian
7165 runs-on : ubuntu-latest
7266 container :
73- image : rhub/debian-gcc- release
67+ image : rhub/ubuntu- release # rhub uses ubuntu for debian tests.
7468 steps :
7569 - name : Install system dependencies
7670 run : |
7771 # Must run before checkout to have the latest git installed.
78- # No need to add pandoc, the container has it figured out.
79- apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git librsvg2-dev librsvg2-2 -y
72+ apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git librsvg2-dev librsvg2-2 pandoc -y
8073 - name : Trust git cloning project sources
8174 run : |
8275 git config --global --add safe.directory "${GITHUB_WORKSPACE}"
9083 - name : Test R
9184 shell : bash -l {0}
9285 run : |
93- python3 ops/script/test_r_package.py --r=/usr /bin/R --build-tool=autotools --task=check
86+ python3 ops/script/test_r_package.py --r=/opt/R/release /bin/R --build-tool=autotools --task=check
9487 - uses : dorny/paths-filter@v3
88+ # Run the document check if there are changes in the R package.
9589 id : changes
9690 with :
9791 filters : |
@@ -100,4 +94,12 @@ jobs:
10094 - name : Run document check
10195 if : steps.changes.outputs.r_package == 'true'
10296 run : |
103- python3 ops/script/test_r_package.py --r=/usr/bin/R --task=doc
97+ python3 ops/script/test_r_package.py --r=/opt/R/release/bin/R --task=doc
98+ - name : Run lintr
99+ run : |
100+ # Prevent the linter from checking generated R scripts.
101+ if [ -d ./xgboost.Rcheck ] ; then
102+ rm -rf ./xgboost.Rcheck
103+ fi
104+ MAKEFLAGS="-j$(nproc)" R CMD INSTALL R-package/
105+ Rscript ops/script/lint_r.R $(pwd)
0 commit comments