diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index f20b6fd40157..26e8fa34c119 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -25,7 +25,5 @@ jobs: usesh: true prepare: | pkg install -y cmake git ninja googletest bash - run: | - bash ops/script/build_via_cmake.sh - ./build/testxgboost + bash ops/pipeline/test-freebsd.sh diff --git a/.github/workflows/sycl_tests.yml b/.github/workflows/sycl_tests.yml index babf9184fe86..180c62310765 100644 --- a/.github/workflows/sycl_tests.yml +++ b/.github/workflows/sycl_tests.yml @@ -36,11 +36,8 @@ jobs: run: | conda info conda list - - name: Build and install XGBoost - run: | - bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON - name: Run gtest - run: ./build/testxgboost + run: bash ops/pipeline/build-test-sycl.sh gtest python-sycl-tests-on-ubuntu: name: Test XGBoost Python package with SYCL @@ -61,11 +58,5 @@ jobs: run: | conda info conda list - - name: Build and install XGBoost - run: | - bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON - cd python-package - python --version - pip install -v . - name: Test Python package - run: pytest -s -v -rxXs --durations=0 ./tests/python-sycl/ + run: bash ops/pipeline/build-test-sycl.sh pytest diff --git a/jvm-packages/xgboost4j-example/model/dump.raw.txt b/jvm-packages/xgboost4j-example/model/dump.raw.txt new file mode 100644 index 000000000000..91c6417f383f --- /dev/null +++ b/jvm-packages/xgboost4j-example/model/dump.raw.txt @@ -0,0 +1,14 @@ +booster[0]: +0:[odor=none] yes=1,no=2 +1:[spore-print-color=green] yes=3,no=4 + 3:leaf=1.92847228 + 4:leaf=-1.87165487 +2:[stalk-root=club] yes=5,no=6 + 5:leaf=-1.63159156 + 6:leaf=1.78592122 +booster[1]: +0:[stalk-root=rooted] yes=1,no=2 + 1:leaf=-6.24725294 +2:[odor=none] yes=3,no=4 + 3:leaf=-0.967758596 + 4:leaf=0.784398556 diff --git a/ops/pipeline/build-test-sycl.sh b/ops/pipeline/build-test-sycl.sh new file mode 100755 index 000000000000..644c0c9276f1 --- /dev/null +++ b/ops/pipeline/build-test-sycl.sh @@ -0,0 +1,32 @@ +#!/bin/bash +## Build and test oneAPI + +set -euox pipefail + +if [[ "$#" -lt 1 ]] +then + echo "Usage: $0 {gtest,pytest}" + exit 1 +fi + +suite="$1" + +mkdir build +pushd build +cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ \ + -DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -GNinja +ninja +popd + +case "$suite" in + gtest) + ./build/testxgboost + ;; + pytest) + cd python-package + python --version + pip install -v . + pytest -s -v -rxXs --durations=0 ./tests/python-sycl/ + ;; +esac diff --git a/ops/pipeline/test-freebsd.sh b/ops/pipeline/test-freebsd.sh new file mode 100755 index 000000000000..f9ed61e9e2b8 --- /dev/null +++ b/ops/pipeline/test-freebsd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +## Run tests on FreeBSD + +set -euox pipefail + +mkdir build +cd build +cmake .. -GNinja -DGOOGLE_TEST=ON +ninja -v +./testxgboost