@@ -41,12 +41,46 @@ jobs:
41
41
run : |
42
42
python tests/ci_build/lint_python.py --format=0 --type-check=0 --pylint=1
43
43
44
+ python-sdist-test-on-Linux :
45
+ # Mismatched glibcxx version between system and conda forge.
46
+ runs-on : ${{ matrix.os }}
47
+ name : Test installing XGBoost Python source package on ${{ matrix.os }}
48
+ strategy :
49
+ matrix :
50
+ os : [ubuntu-latest]
51
+ steps :
52
+ - uses : actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
53
+ with :
54
+ submodules : ' true'
55
+ - uses : mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
56
+ with :
57
+ cache-downloads : true
58
+ cache-env : false
59
+ environment-name : sdist_test
60
+ environment-file : tests/ci_build/conda_env/sdist_test.yml
61
+ - name : Display Conda env
62
+ shell : bash -l {0}
63
+ run : |
64
+ conda info
65
+ conda list
66
+ - name : Build and install XGBoost
67
+ shell : bash -l {0}
68
+ run : |
69
+ cd python-package
70
+ python --version
71
+ python setup.py sdist
72
+ pip install -v ./dist/xgboost-*.tar.gz
73
+ cd ..
74
+ python -c 'import xgboost'
75
+
44
76
python-sdist-test :
77
+ # Use system toolchain instead of conda toolchain for macos and windows.
78
+ # MacOS has linker error if clang++ from conda-forge is used
45
79
runs-on : ${{ matrix.os }}
46
80
name : Test installing XGBoost Python source package on ${{ matrix.os }}
47
81
strategy :
48
82
matrix :
49
- os : [ubuntu-latest, macos-11, windows-latest]
83
+ os : [macos-11, windows-latest]
50
84
python-version : ["3.8"]
51
85
steps :
52
86
- uses : actions/checkout@v2
56
90
if : matrix.os == 'macos-11'
57
91
run : |
58
92
brew install ninja libomp
59
- - name : Install Ubuntu system dependencies
60
- if : matrix.os == 'ubuntu-latest'
61
- run : |
62
- sudo apt-get install -y --no-install-recommends ninja-build
63
- - uses : conda-incubator/setup-miniconda@v2
93
+ - uses : conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169 # v2.1.1
64
94
with :
65
95
auto-update-conda : true
66
96
python-version : ${{ matrix.python-version }}
@@ -80,61 +110,65 @@ jobs:
80
110
cd ..
81
111
python -c 'import xgboost'
82
112
83
- python-tests-on-win :
113
+ python-tests-on-macos :
84
114
name : Test XGBoost Python package on ${{ matrix.config.os }}
85
115
runs-on : ${{ matrix.config.os }}
116
+ timeout-minutes : 60
86
117
strategy :
87
118
matrix :
88
119
config :
89
- - {os: windows-latest, python-version: '3.8' }
120
+ - {os: macos-11 }
90
121
91
122
steps :
92
- - uses : actions/checkout@v2
123
+ - uses : actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
93
124
with :
94
125
submodules : ' true'
95
126
96
- - uses : conda-incubator/setup-miniconda@v2
127
+ - uses : mamba-org/provision-with-micromamba@f347426e5745fe3dfc13ec5baf20496990d0281f # v14
97
128
with :
98
- auto-update-conda : true
99
- python-version : ${{ matrix.config.python-version }}
100
- activate- environment: win64_env
101
- environment-file : tests/ci_build/conda_env/win64_cpu_test .yml
129
+ cache-downloads : true
130
+ cache-env : false
131
+ environment-name : macos_test
132
+ environment-file : tests/ci_build/conda_env/macos_cpu_test .yml
102
133
103
134
- name : Display Conda env
104
135
shell : bash -l {0}
105
136
run : |
106
137
conda info
107
138
conda list
108
139
109
- - name : Build XGBoost on Windows
140
+ - name : Build XGBoost on macos
110
141
shell : bash -l {0}
111
142
run : |
112
- mkdir build_msvc
113
- cd build_msvc
114
- cmake .. -G"Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -A x64 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON
115
- cmake --build . --config Release --parallel $(nproc)
143
+ brew install ninja
144
+
145
+ mkdir build
146
+ cd build
147
+ # Set prefix, to use OpenMP library from Conda env
148
+ # See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
149
+ # to learn why we don't use libomp from Homebrew.
150
+ cmake .. -GNinja -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
151
+ ninja
116
152
117
153
- name : Install Python package
118
154
shell : bash -l {0}
119
155
run : |
120
156
cd python-package
121
157
python --version
122
- python setup.py bdist_wheel --universal
123
- pip install ./dist/*.whl
158
+ python setup.py install
124
159
125
160
- name : Test Python package
126
161
shell : bash -l {0}
127
162
run : |
128
- pytest -s -v ./tests/python
163
+ pytest -s -v -rxXs --durations=0 ./tests/python
129
164
130
- python-tests-on-macos :
165
+ python-tests-on-win :
131
166
name : Test XGBoost Python package on ${{ matrix.config.os }}
132
167
runs-on : ${{ matrix.config.os }}
133
- timeout-minutes : 90
134
168
strategy :
135
169
matrix :
136
170
config :
137
- - {os: macos-11 , python-version " 3.8" }
171
+ - {os: windows-latest , python-version: ' 3.8' }
138
172
139
173
steps :
140
174
- uses : actions/checkout@v2
@@ -145,36 +179,32 @@ jobs:
145
179
with :
146
180
auto-update-conda : true
147
181
python-version : ${{ matrix.config.python-version }}
148
- activate-environment : macos_test
149
- environment-file : tests/ci_build/conda_env/macos_cpu_test .yml
182
+ activate-environment : win64_env
183
+ environment-file : tests/ci_build/conda_env/win64_cpu_test .yml
150
184
151
185
- name : Display Conda env
152
186
shell : bash -l {0}
153
187
run : |
154
188
conda info
155
189
conda list
156
190
157
- - name : Build XGBoost on macos
191
+ - name : Build XGBoost on Windows
158
192
shell : bash -l {0}
159
193
run : |
160
- brew install ninja
161
-
162
- mkdir build
163
- cd build
164
- # Set prefix, to use OpenMP library from Conda env
165
- # See https://github.com/dmlc/xgboost/issues/7039#issuecomment-1025038228
166
- # to learn why we don't use libomp from Homebrew.
167
- cmake .. -GNinja -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
168
- ninja
194
+ mkdir build_msvc
195
+ cd build_msvc
196
+ cmake .. -G"Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -A x64 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON
197
+ cmake --build . --config Release --parallel $(nproc)
169
198
170
199
- name : Install Python package
171
200
shell : bash -l {0}
172
201
run : |
173
202
cd python-package
174
203
python --version
175
- python setup.py install
204
+ python setup.py bdist_wheel --universal
205
+ pip install ./dist/*.whl
176
206
177
207
- name : Test Python package
178
208
shell : bash -l {0}
179
209
run : |
180
- pytest -s -v ./tests/python
210
+ pytest -s -v -rxXs --durations=0 ./tests/python
0 commit comments