[CI] Test R package with CMake (#10087)
* [CI] Test R package with CMake * Fix * Fix * Update test_r_package.py * Fix CMake flag for R package * Install system deps * Fix * Use sudo
This commit is contained in:
parent
d07b7fe8c8
commit
23a37dcaf9
14
.github/workflows/r_tests.yml
vendored
14
.github/workflows/r_tests.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
||||
MAKEFLAGS="-j$(nproc)" R CMD INSTALL R-package/
|
||||
Rscript tests/ci_build/lint_r.R $(pwd)
|
||||
|
||||
test-R-on-Windows:
|
||||
test-Rpkg:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
name: Test R on OS ${{ matrix.config.os }}, R ${{ matrix.config.r }}, Compiler ${{ matrix.config.compiler }}, Build ${{ matrix.config.build }}
|
||||
strategy:
|
||||
@ -54,11 +54,17 @@ jobs:
|
||||
matrix:
|
||||
config:
|
||||
- {os: windows-latest, r: 'release', compiler: 'mingw', build: 'autotools'}
|
||||
- {os: ubuntu-latest, r: 'release', compiler: 'none', build: 'cmake'}
|
||||
env:
|
||||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
|
||||
RSPM: ${{ matrix.config.rspm }}
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev
|
||||
if: matrix.config.os == 'ubuntu-latest'
|
||||
- uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
|
||||
with:
|
||||
submodules: 'true'
|
||||
@ -89,6 +95,12 @@ jobs:
|
||||
- name: Test R
|
||||
run: |
|
||||
python tests/ci_build/test_r_package.py --compiler='${{ matrix.config.compiler }}' --build-tool="${{ matrix.config.build }}" --task=check
|
||||
if: matrix.config.compiler != 'none'
|
||||
|
||||
- name: Test R
|
||||
run: |
|
||||
python tests/ci_build/test_r_package.py --build-tool="${{ matrix.config.build }}" --task=check
|
||||
if: matrix.config.compiler == 'none'
|
||||
|
||||
test-R-on-Debian:
|
||||
name: Test R package on Debian
|
||||
|
||||
@ -26,7 +26,6 @@ endif()
|
||||
target_compile_definitions(
|
||||
xgboost-r PUBLIC
|
||||
-DXGBOOST_STRICT_R_MODE=1
|
||||
-DXGBOOST_CUSTOMIZE_GLOBAL_PRNG=1
|
||||
-DDMLC_LOG_BEFORE_THROW=0
|
||||
-DDMLC_DISABLE_STDIN=1
|
||||
-DDMLC_LOG_CUSTOMIZE=1
|
||||
|
||||
@ -277,6 +277,19 @@ def test_with_cmake(args: argparse.Namespace) -> None:
|
||||
"Release",
|
||||
]
|
||||
)
|
||||
elif args.compiler == "none":
|
||||
subprocess.check_call(
|
||||
[
|
||||
"cmake",
|
||||
os.path.pardir,
|
||||
"-DUSE_OPENMP=ON",
|
||||
"-DR_LIB=ON",
|
||||
"-DCMAKE_CONFIGURATION_TYPES=Release",
|
||||
"-G",
|
||||
"Unix Makefiles",
|
||||
]
|
||||
)
|
||||
subprocess.check_call(["make", "-j", "install"])
|
||||
else:
|
||||
raise ValueError("Wrong compiler")
|
||||
with DirectoryExcursion(R_PACKAGE):
|
||||
@ -333,9 +346,9 @@ if __name__ == "__main__":
|
||||
parser.add_argument(
|
||||
"--compiler",
|
||||
type=str,
|
||||
choices=["mingw", "msvc"],
|
||||
choices=["mingw", "msvc", "none"],
|
||||
help="Compiler used for compiling CXX code. Only relevant for windows build",
|
||||
default="mingw",
|
||||
default="none",
|
||||
required=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user