##// END OF EJS Templates
wheel: assign CIBW_SKIP globally...
marmoute -
r53124:d0e728b0 stable
parent child Browse files
Show More
@@ -1,373 +1,376
1 1 # Don't run pipelines on branch "merge", since we're fast-forward only.
2 2 # Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
3 3 # `branch/stable`), but the hash hasn't changed. There is no reason to
4 4 # re-run the CI in our case, since we haven't built up any specific automation.
5 5 # Right now it's just wasted CI and developer time.
6 6 # One can still run the pipeline manually via the web interface,
7 7 # like in the case of releases, to make *extra* sure that the actual branch
8 8 # has succeeded.
9 9 workflow:
10 10 rules:
11 11 - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
12 12 when: never
13 13 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
14 14 when: never
15 15 - if: $CI_PIPELINE_SOURCE == "push"
16 16 when: always
17 17 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
18 18 when: never
19 19 - if: $CI_COMMIT_BRANCH
20 20 when: always
21 21
22 22 stages:
23 23 - build
24 24 - checks
25 25 - tests
26 26 - platform-compat
27 27 - py-version-compat
28 28
29 29
30 30 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
31 31
32 32 variables:
33 33 PYTHON: python
34 34 HG_CI_IMAGE_TAG: "v2.1"
35 35 # a directory dedicated to creating files and temporary clone
36 36 # with shell runner, its content is not cleaned from one call to the next,
37 37 # so plan for it.
38 38 TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
39 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
40 # needed nor working.
41 CIBW_SKIP: "pp*"
39 42
40 43 .all:
41 44 # help changing all job at once when debugging
42 45 when: on_success
43 46 # make sure jobs from later steps does not wait for anything implicit before
44 47 # starting.
45 48 needs: []
46 49
47 50 .build-wheel:
48 51 extends: .all
49 52 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
50 53 stage: build
51 54 variables:
52 55 WHEEL_TYPE: ""
53 56 FLAVOR: ""
54 57 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
55 58 CI_CLEVER_CLOUD_FLAVOR: "XS"
56 59 before_script:
57 60 - echo $WHEEL_TYPE
58 61 - test -n "$WHEEL_TYPE"
59 62 - echo $FLAVOR
60 63 - mkdir -p wheels/$WHEEL_TYPE/$BUILD_PY_ID
61 64 script:
62 65 - /opt/python/$BUILD_PY_ID/bin/python setup.py bdist_wheel --dist-dir tmp-wheelhouse
63 66 - auditwheel repair tmp-wheelhouse/*.whl -w wheels/$WHEEL_TYPE/$BUILD_PY_ID
64 67 artifacts:
65 68 paths:
66 69 - wheels/$WHEEL_TYPE/$BUILD_PY_ID
67 70 expire_in: 1 week
68 71
69 72 build-c-wheel:
70 73 extends: .build-wheel
71 74 variables:
72 75 WHEEL_TYPE: "c"
73 76 parallel:
74 77 matrix:
75 78 - BUILD_PY_ID:
76 79 - cp38-cp38
77 80 - cp39-cp39
78 81 - cp310-cp310
79 82 - cp311-cp311
80 83 - cp312-cp312
81 84 - cp313-cp313
82 85
83 86 .runtests:
84 87 extends: .all
85 88 stage: tests
86 89 variables:
87 90 SHOW_VERSION_OF: "$PYTHON"
88 91 TEST_HGTESTS_ALLOW_NETIO: "0"
89 92 FILTER: ""
90 93 FLAVOR: ""
91 94 RUNTEST_ARGS: ""
92 95 # The runner made a clone as root.
93 96 # We make a new clone owned by user used to run the step.
94 97 before_script:
95 98 - echo "python used, $PYTHON"
96 99 - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
97 100 - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers
98 101 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
99 102 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
100 103 - cd "${TMP_WORK_DIR}"/mercurial-ci/
101 104 - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
102 105 script:
103 106 - echo "$TEST_HGTESTS_ALLOW_NETIO"
104 107 - echo "$RUNTEST_ARGS"
105 108 - echo "$FILTER"
106 109 - echo "$FLAVOR"
107 110 - echo "$WHEEL_TYPE"
108 111 - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID`
109 112 - PORT_ARG="--port $PORT_START"
110 113 - echo $PORT_ARG
111 114 - WHEEL_ARG=""
112 115 - SHARDING_ARGS=""
113 116 - if test -n "$WHEEL_TYPE"; then
114 117 PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
115 118 echo "$PY_TAG";
116 119 test -n "PY_TAG";
117 120 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/$PY_TAG/*.whl`";
118 121 test -n "$WHEEL";
119 122 echo installing from $WHEEL;
120 123 WHEEL_ARG="--hg-wheel $WHEEL";
121 124 echo disabling flavor as this is currently incompatible with '"--hg-wheel"';
122 125 FLAVOR="";
123 126 else
124 127 echo installing from source;
125 128 fi;
126 129 - if [ -n "$CI_NODE_INDEX" ]; then
127 130 echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]";
128 131 SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL";
129 132 echo "sharding... $SHARDING_ARGS";
130 133 fi
131 134 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
132 135 "$PYTHON" tests/run-tests.py
133 136 --color=always
134 137 $PORT_ARG
135 138 $WHEEL_ARG
136 139 $FLAVOR
137 140 $SHARDING_ARGS
138 141 $FILTER
139 142 $RUNTEST_ARGS;
140 143
141 144 checks:
142 145 extends: .runtests
143 146 stage: checks
144 147 variables:
145 148 SHOW_VERSION_OF: "$PYTHON black clang-format"
146 149 RUNTEST_ARGS: "--time"
147 150 FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
148 151 CI_CLEVER_CLOUD_FLAVOR: S
149 152
150 153 rust-cargo-test:
151 154 extends: .all
152 155 stage: checks
153 156 script:
154 157 - make rust-tests
155 158 - make cargo-clippy
156 159 variables:
157 160 CI_CLEVER_CLOUD_FLAVOR: S
158 161
159 162 .runtests-no-check:
160 163 extends: .runtests
161 164 variables:
162 165 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
163 166 TEST_HGTESTS_ALLOW_NETIO: "1"
164 167
165 168 .test-c:
166 169 extends: .runtests-no-check
167 170 variables:
168 171 FLAVOR: "--no-rust"
169 172
170 173 test-c:
171 174 extends: .test-c
172 175 needs:
173 176 - job: build-c-wheel
174 177 parallel:
175 178 matrix:
176 179 - BUILD_PY_ID: "cp311-cp311"
177 180 variables:
178 181 WHEEL_TYPE: "c"
179 182
180 183 test-pure:
181 184 extends: .runtests-no-check
182 185 variables:
183 186 FLAVOR: "--pure"
184 187
185 188 test-rust:
186 189 extends: .runtests-no-check
187 190 variables:
188 191 HGWITHRUSTEXT: "cpython"
189 192 FLAVOR: "--rust"
190 193
191 194 test-rhg:
192 195 extends: .runtests-no-check
193 196 variables:
194 197 HGWITHRUSTEXT: "cpython"
195 198 FLAVOR: "--rust --rhg"
196 199
197 200 test-chg:
198 201 extends: .runtests-no-check
199 202 variables:
200 203 FLAVOR: "--chg"
201 204
202 205 # note: we should probably get a full matrix for flavor Γ— py-version, but this
203 206 # is a simple start to be able to check if we break the lowest supported
204 207 # version (and 3.12 have been giving us various troubles)
205 208 test-3.8-c:
206 209 extends: .test-c
207 210 stage: py-version-compat
208 211 when: manual # avoid overloading the CI by default
209 212 variables:
210 213 PYTHON: python3.8
211 214 WHEEL_TYPE: "c"
212 215 needs:
213 216 - job: build-c-wheel
214 217 parallel:
215 218 matrix:
216 219 - BUILD_PY_ID: "cp38-cp38"
217 220
218 221 test-3.12-c:
219 222 extends: .test-c
220 223 stage: py-version-compat
221 224 when: manual # avoid overloading the CI by default
222 225 variables:
223 226 PYTHON: python3.12
224 227 WHEEL_TYPE: "c"
225 228 needs:
226 229 - job: build-c-wheel
227 230 parallel:
228 231 matrix:
229 232 - BUILD_PY_ID: "cp312-cp312"
230 233
231 234 test-3.12-rust:
232 235 extends: test-rust
233 236 stage: py-version-compat
234 237 when: manual # avoid overloading the CI by default
235 238 variables:
236 239 PYTHON: python3.12
237 240
238 241 test-3.13-c:
239 242 extends: .test-c
240 243 stage: py-version-compat
241 244 when: manual # avoid overloading the CI by default
242 245 variables:
243 246 PYTHON: python3.13
244 247 WHEEL_TYPE: "c"
245 248 needs:
246 249 - job: build-c-wheel
247 250 parallel:
248 251 matrix:
249 252 - BUILD_PY_ID: "cp313-cp313"
250 253
251 254 test-3.13-rust:
252 255 extends: test-rust
253 256 stage: py-version-compat
254 257 when: manual # avoid overloading the CI by default
255 258 variables:
256 259 PYTHON: python3.13
257 260
258 261 check-pytype:
259 262 extends: test-rust
260 263 stage: checks
261 264 before_script:
262 265 - export PATH="/home/ci-runner/vendor/pyenv/pyenv-2.4.7-adf3c2bccf09cdb81febcfd15b186711a33ac7a8/shims:/home/ci-runner/vendor/pyenv/pyenv-2.4.7-adf3c2bccf09cdb81febcfd15b186711a33ac7a8/bin:$PATH"
263 266 - echo "PATH, $PATH"
264 267 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
265 268 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
266 269 - cd "${TMP_WORK_DIR}"/mercurial-ci/
267 270 - make local PYTHON=$PYTHON
268 271 - ./contrib/setup-pytype.sh
269 272 script:
270 273 - echo "Entering script section"
271 274 - sh contrib/check-pytype.sh
272 275
273 276 # `sh.exe --login` sets a couple of extra environment variables that are defined
274 277 # in the MinGW shell, but switches CWD to /home/$username. The previous value
275 278 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
276 279 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
277 280 # that satisfies the various shebang lines and delegates to `py -3`.
278 281
279 282 .windows:
280 283 extends: .all
281 284 when: manual # we don't have any Windows runners anymore at the moment
282 285 tags:
283 286 - windows
284 287 before_script:
285 288 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt'
286 289 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
287 290 variables:
288 291 PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
289 292
290 293 .windows-runtests:
291 294 extends: .windows
292 295 stage: platform-compat
293 296 script:
294 297 - echo "Entering script section"
295 298 - echo "python used, $Env:PYTHON"
296 299 - Invoke-Expression "$Env:PYTHON -V"
297 300 - echo "$Env:HGTESTS_ALLOW_NETIO"
298 301 - echo "$Env:FLAVOR"
299 302 - echo "$Env:FILTER"
300 303 - echo "$Env:RUNTEST_ARGS"
301 304 - echo "$Env:TMP"
302 305 - echo "$Env:TEMP"
303 306 # This test is hanging the worker and not that important, so lets skip
304 307 # it for now
305 308 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt'
306 309
307 310 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe
308 311 --login -c 'cd "$OLDPWD"
309 312 && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
310 313 $PYTHON tests/run-tests.py
311 314 --color=always
312 315 $FLAVOR
313 316 --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID`
314 317 $FILTER
315 318 $RUNTEST_ARGS;
316 319 '
317 320 variables:
318 321 RUNTEST_ARGS: ""
319 322 FLAVOR: ""
320 323 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt"
321 324
322 325 windows:
323 326 extends: .windows-runtests
324 327 variables:
325 328 RUNTEST_ARGS: "-j 8"
326 329
327 330 windows-pyox:
328 331 extends: .windows-runtests
329 332 when: manual # pyoxidizer builds seem broken with --no-use-pep517
330 333 variables:
331 334 FLAVOR: "--pyoxidized"
332 335
333 336 macos:
334 337 extends: .test-c
335 338 stage: platform-compat
336 339 # run the test in multiple shard to help spread the load between concurrent
337 340 # MR as the macos runner is a shell runner there is not startup overhead
338 341 # for tests.
339 342 parallel: 10
340 343 tags:
341 344 - macos
342 345 variables:
343 346 WHEEL_TYPE: "c"
344 347 needs:
345 348 - build-c-wheel-macos
346 349
347 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
348 # needed nor working.
350 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
351 # this is the only one we need to test. However testing that build work on all
352 # version is useful and match what we do with Linux.
349 353 #
350 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
351 # this is the only one we need to test. However testing that build work on all version is useful and match what we do with Linux.
354 # CIBW_SKIP is set globally at the start of the file. See comment there.
352 355 #
353 356 # The weird directory structure match the one we use for Linux to deal with the
354 357 # multiple jobs. (all this might be unnecessary)
355 358 build-c-wheel-macos:
356 359 when: manual # avoid overloading the CI by default
357 360 stage: build
358 361 tags:
359 362 - macos
360 363 variables:
361 364 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
362 365 script:
363 366 - rm -rf tmp-wheels
364 - CIBW_SKIP="pp*" cibuildwheel --output-dir tmp-wheels/
367 - cibuildwheel --output-dir tmp-wheels/
365 368 - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
366 369 mkdir -p wheels/c/$py_version/;
367 370 mv tmp-wheels/*$py_version*.whl wheels/c/$py_version/;
368 371 done
369 372 - rm -rf tmp-wheels
370 373 artifacts:
371 374 paths:
372 375 - wheels
373 376 expire_in: 1 week
General Comments 0
You need to be logged in to leave comments. Login now