Skip to content

Commit eef98c7

Browse files
committed
Move all commands to separate script files
1 parent 2d37469 commit eef98c7

17 files changed

+125
-198
lines changed

.github/workflows/freebsd.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ jobs:
2727
pkg install -y cmake git ninja googletest
2828
2929
run: |
30-
mkdir build
31-
cd build
32-
cmake .. -GNinja -DGOOGLE_TEST=ON
33-
ninja -v
34-
./testxgboost
30+
bash ops/script/build_via_cmake.sh
31+
./build/testxgboost

.github/workflows/jvm_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ jobs:
232232
run: |
233233
cd lib/
234234
Rename-Item -Path xgboost4j.dll -NewName xgboost4j_${{ github.sha }}.dll
235-
dir
236235
python -m awscli s3 cp xgboost4j_${{ github.sha }}.dll `
237236
s3://xgboost-nightly-builds/${{ env.BRANCH_NAME }}/libxgboost4j/ `
238237
--acl public-read --region us-west-2

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,14 @@ jobs:
268268
KEY: ${{ matrix.artifact_from }}
269269
- run: bash ops/pipeline/test-cpp-gpu.sh ${{ matrix.suite }}
270270

271-
test-python:
271+
test-python-wheel:
272272
name: Run Python tests (${{ matrix.description }})
273273
needs: [build-cuda, build-cpu-arm64]
274274
runs-on:
275275
- runs-on
276276
- runner=${{ matrix.runner }}
277277
- run-id=${{ github.run_id }}
278-
- tag=main-test-python-${{ matrix.description }}
278+
- tag=main-test-python-wheel-${{ matrix.description }}
279279
strategy:
280280
fail-fast: false
281281
max-parallel: 2
@@ -329,4 +329,4 @@ jobs:
329329
COMMAND: download
330330
KEY: ${{ matrix.artifact_from }}
331331
- name: Run Python tests, ${{ matrix.description }}
332-
run: bash ops/pipeline/test-python.sh ${{ matrix.suite }} ${{ matrix.container }}
332+
run: bash ops/pipeline/test-python-wheel.sh ${{ matrix.suite }} ${{ matrix.container }}

.github/workflows/misc.yml

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,6 @@ env:
1414
${{ github.event.pull_request.number && 'PR-' }}${{ github.event.pull_request.number || github.ref_name }}
1515
1616
jobs:
17-
gtest-cpu:
18-
name: Test Google C++ test (CPU)
19-
runs-on: macos-13
20-
steps:
21-
- uses: actions/checkout@v4
22-
with:
23-
submodules: 'true'
24-
- name: Install system packages
25-
run: |
26-
brew install ninja libomp
27-
- name: Build gtest binary
28-
run: |
29-
mkdir build
30-
cd build
31-
cmake .. -DGOOGLE_TEST=ON -DUSE_OPENMP=ON -DUSE_DMLC_GTEST=ON -GNinja -DBUILD_DEPRECATED_CLI=ON -DUSE_SANITIZER=ON -DENABLED_SANITIZERS=address -DCMAKE_BUILD_TYPE=RelWithDebInfo
32-
ninja -v
33-
- name: Run gtest binary
34-
run: |
35-
cd build
36-
./testxgboost
37-
ctest -R TestXGBoostCLI --extra-verbose
38-
3917
gtest-cpu-nonomp:
4018
name: Test Google C++ unittest (CPU Non-OMP)
4119
runs-on: ubuntu-latest
@@ -47,12 +25,7 @@ jobs:
4725
run: |
4826
sudo apt-get install -y --no-install-recommends ninja-build
4927
- name: Build and install XGBoost
50-
shell: bash -l {0}
51-
run: |
52-
mkdir build
53-
cd build
54-
cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DUSE_OPENMP=OFF -DBUILD_DEPRECATED_CLI=ON
55-
ninja -v
28+
run: bash ops/script/build_via_cmake.sh -DUSE_OPENMP=OFF
5629
- name: Run gtest binary
5730
run: |
5831
cd build
@@ -79,42 +52,5 @@ jobs:
7952
run: |
8053
conda info
8154
conda list
82-
- name: Build and install XGBoost static library
83-
run: |
84-
mkdir build
85-
cd build
86-
cmake .. -DBUILD_STATIC_LIB=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja
87-
ninja -v install
88-
cd -
89-
- name: Build and run C API demo with static
90-
run: |
91-
pushd .
92-
cd demo/c-api/
93-
mkdir build
94-
cd build
95-
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
96-
ninja -v
97-
ctest
98-
cd ..
99-
rm -rf ./build
100-
popd
101-
102-
- name: Build and install XGBoost shared library
103-
run: |
104-
cd build
105-
cmake .. -DBUILD_STATIC_LIB=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja -DPLUGIN_FEDERATED=ON -DGOOGLE_TEST=ON
106-
ninja -v install
107-
./testxgboost
108-
cd -
10955
- name: Build and run C API demo with shared
110-
run: |
111-
pushd .
112-
cd demo/c-api/
113-
mkdir build
114-
cd build
115-
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
116-
ninja -v
117-
ctest
118-
popd
119-
./ops/script/verify_link.sh ./demo/c-api/build/basic/api-demo
120-
./ops/script/verify_link.sh ./demo/c-api/build/external-memory/external-memory-demo
56+
run: bash ops/pipeline/test-c-api-demo.sh

.github/workflows/python_tests.yml

Lines changed: 12 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
python-sdist-test-on-Linux:
18-
runs-on: ubuntu-latest
19-
name: Test installing XGBoost Python source package
17+
python-sdist-test:
18+
runs-on: ${{ matrix.os }}
19+
name: Test installing Python XGBoost from the source distribution (${{ matrix.os }})
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [macos-13, windows-latest, ubuntu-latest]
2024
steps:
2125
- uses: actions/checkout@v4
2226
with:
@@ -32,53 +36,12 @@ jobs:
3236
run: |
3337
conda info
3438
conda list
35-
- name: Build and install XGBoost
39+
- name: Install extra package for MacOS
3640
run: |
37-
cd python-package
38-
python --version
39-
python -m build --sdist
40-
pip install -v ./dist/xgboost-*.tar.gz --config-settings use_openmp=False
41-
cd ..
42-
python -c 'import xgboost'
43-
44-
python-sdist-test:
45-
# Use system toolchain instead of conda toolchain for macos and windows.
46-
# MacOS has linker error if clang++ from conda-forge is used
47-
runs-on: ${{ matrix.os }}
48-
name: Test installing XGBoost Python source package on ${{ matrix.os }}
49-
strategy:
50-
fail-fast: false
51-
matrix:
52-
os: [macos-13, windows-latest]
53-
python-version: ["3.10"]
54-
steps:
55-
- uses: actions/checkout@v4
56-
with:
57-
submodules: 'true'
58-
- name: Install osx system dependencies
41+
mamba install -c conda-forge llvm-openmp
5942
if: matrix.os == 'macos-13'
60-
run: |
61-
brew install ninja libomp
62-
- uses: conda-incubator/setup-miniconda@v3
63-
with:
64-
auto-update-conda: true
65-
python-version: ${{ matrix.python-version }}
66-
activate-environment: test
67-
- name: Install build
68-
run: |
69-
conda install -c conda-forge python-build
70-
- name: Display Conda env
71-
run: |
72-
conda info
73-
conda list
7443
- name: Build and install XGBoost
75-
run: |
76-
cd python-package
77-
python --version
78-
python -m build --sdist
79-
pip install -v ./dist/xgboost-*.tar.gz
80-
cd ..
81-
python -c 'import xgboost'
44+
run: bash ops/pipeline/test-python-sdist.sh
8245

8346
python-tests-on-macos:
8447
name: Test XGBoost Python package on macos-13
@@ -102,31 +65,7 @@ jobs:
10265
conda info
10366
conda list
10467
105-
- name: Build XGBoost on macos
106-
run: |
107-
brew install ninja
108-
109-
mkdir build
110-
cd build
111-
# Set prefix, to use OpenMP library from Conda env
112-
# See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
113-
# to learn why we don't use libomp from Homebrew.
114-
cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_DEPRECATED_CLI=ON
115-
ninja
116-
117-
- name: Install Python package
118-
run: |
119-
cd python-package
120-
python --version
121-
pip install -v .
122-
123-
- name: Test Python package
124-
run: |
125-
pytest -s -v -rxXs --durations=0 ./tests/python
126-
127-
- name: Test Dask Interface
128-
run: |
129-
pytest -s -v -rxXs --durations=0 ./tests/test_distributed/test_with_dask
68+
- run: bash ops/pipeline/test-python-macos.sh
13069

13170
python-system-installation-on-ubuntu:
13271
name: Test XGBoost Python package System Installation on Ubuntu
@@ -135,32 +74,8 @@ jobs:
13574
- uses: actions/checkout@v4
13675
with:
13776
submodules: 'true'
138-
13977
- name: Set up Python 3.10
14078
uses: actions/setup-python@v5
14179
with:
14280
python-version: "3.10"
143-
144-
- name: Install ninja
145-
run: |
146-
sudo apt-get update && sudo apt-get install -y ninja-build
147-
148-
- name: Build XGBoost on Ubuntu
149-
run: |
150-
mkdir build
151-
cd build
152-
cmake .. -GNinja
153-
ninja
154-
155-
- name: Copy lib to system lib
156-
run: |
157-
cp lib/* "$(python -c 'import sys; print(sys.base_prefix)')/lib"
158-
159-
- name: Install XGBoost in Virtual Environment
160-
run: |
161-
cd python-package
162-
pip install virtualenv
163-
virtualenv venv
164-
source venv/bin/activate && \
165-
pip install -v . --config-settings use_system_libxgboost=True && \
166-
python -c 'import xgboost'
81+
- run: bash ops/pipeline/test-python-with-sysprefix.sh

.github/workflows/sycl_tests.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,9 @@ jobs:
3838
conda list
3939
- name: Build and install XGBoost
4040
run: |
41-
mkdir build
42-
cd build
43-
cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ \
44-
-DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -GNinja
45-
ninja
41+
bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON
4642
- name: Run gtest
47-
run: |
48-
cd build
49-
./testxgboost
43+
run: ./build/testxgboost
5044

5145
python-sycl-tests-on-ubuntu:
5246
name: Test XGBoost Python package with SYCL
@@ -56,31 +50,22 @@ jobs:
5650
- uses: actions/checkout@v4
5751
with:
5852
submodules: 'true'
59-
6053
- uses: conda-incubator/setup-miniconda@v3
6154
with:
6255
miniforge-variant: Miniforge3
6356
miniforge-version: latest
6457
activate-environment: linux_sycl_test
6558
environment-file: ops/conda_env/linux_sycl_test.yml
6659
use-mamba: true
67-
6860
- name: Display Conda env
6961
run: |
7062
conda info
7163
conda list
72-
- name: Build XGBoost on Ubuntu
73-
run: |
74-
mkdir build
75-
cd build
76-
cmake .. -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc \
77-
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX -GNinja
78-
ninja
79-
- name: Install Python package
64+
- name: Build and install XGBoost
8065
run: |
66+
bash ops/script/build_via_cmake.sh --conda-env=linux_sycl_test -DPLUGIN_SYCL=ON
8167
cd python-package
8268
python --version
8369
pip install -v .
8470
- name: Test Python package
85-
run: |
86-
pytest -s -v -rxXs --durations=0 ./tests/python-sycl/
71+
run: pytest -s -v -rxXs --durations=0 ./tests/python-sycl/

ops/conda_env/sdist_test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ dependencies:
99
- cmake
1010
- ninja
1111
- python-build
12-
- c-compiler
13-
- cxx-compiler

ops/pipeline/build-test-jvm-packages-impl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
## Build and test JVM packages.
3+
## Companion script for build-test-jvm-packages.sh.
34
##
45
## Note. This script takes in all inputs via environment variables.
56

ops/pipeline/classify-git-branch.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
2-
3-
## Detect whether the current git branch is a pull request or a release branch.
2+
## Detect whether the current git branch is a pull request or a release branch
43

54
set -euo pipefail
65

ops/pipeline/deploy-jvm-packages-impl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
2-
## Deploy JVM packages to xgboost-maven-repo S3 bucket
2+
## Deploy JVM packages to S3 bucket
3+
## Companion script for ops/pipeline/deploy-jvm-packages.sh
34

45
set -euox pipefail
56

0 commit comments

Comments
 (0)