##// END OF EJS Templates
ci: simplify the wheel building declaration...
marmoute -
r53408:cbd2f350 default
parent child Browse files
Show More
@@ -1,734 +1,685
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|schedule/"
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 - nightly-trigger
24 24 - build
25 25 - checks
26 26 - tests
27 27 - platform-compat
28 28 - py-version-compat
29 29 - upload
30 30
31 31
32 32 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
33 33
34 34 variables:
35 35 # to debug use:
36 36 #
37 37 # RE_BRANCH: '/^topic/.+/.+$/'
38 38 # RE_TOPIC: '/^xxx/'
39 39 #
40 40 # Instead of the two following lines:
41 41 RE_BRANCH: '/^branch/.+$/'
42 42 RE_TOPIC: '/^topic/.+/.+$/'
43 43 PYTHON: python
44 44 HG_CI_IMAGE_TAG: "v2.1"
45 45 # a directory dedicated to creating files and temporary clone
46 46 # with shell runner, its content is not cleaned from one call to the next,
47 47 # so plan for it.
48 48 TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
49 49 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
50 50 # needed nor working.
51 51 CIBW_SKIP: "pp*"
52 52
53 53 .all:
54 54 # help changing all job at once when debugging
55 55 when: on_success
56 56 # make sure jobs from later steps does not wait for anything implicit before
57 57 # starting.
58 58 needs: []
59 59
60 60 # dummy job that serve dependencies purpose
61 61 .dummy:
62 62 # smallest I know of
63 63 image: busybox
64 64 variables:
65 65 GIT_STRATEGY: none
66 66 CI_CLEVER_CLOUD_FLAVOR: "XS"
67 67 script:
68 68 - echo 'nothing to see here'
69 69
70 70
71 71 # a dummy job that only serve to trigger others
72 72 #
73 73 # This is useful for two reasons:
74 74 # - the UX around parallel jobs is awful so manually starting them is unpractical
75 75 # - manual starting job cannot make the pipeline "fails" and block a merge,
76 76 # while "on_success" job depending on manual trigger works fine in that regard.
77 77 .trigger:
78 78 extends:
79 79 - .all
80 80 - .dummy
81 81 when: manual
82 82
83 83
84 84 trigger-nightly-build:
85 85 extends: .trigger
86 86 stage: nightly-trigger
87 87 rules:
88 88 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH && $CI_PIPELINE_SOURCE == "schedule"
89 89 when: always
90 90 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
91 91 when: manual
92 92 allow_failure: true
93 93 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
94 94 when: never
95 95
96 96 .build-wheel:
97 97 extends: .all
98 98 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
99 99 stage: build
100 100 variables:
101 101 WHEEL_TYPE: ""
102 102 FLAVOR: ""
103 103 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
104 104 CI_CLEVER_CLOUD_FLAVOR: "XS"
105 105 script:
106 106 - PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'`
107 107 - echo $WHEEL_TYPE
108 108 - test -n "$WHEEL_TYPE"
109 109 - echo $FLAVOR
110 110 - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
111 111 - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
112 112 artifacts:
113 113 paths:
114 114 - wheels/
115 115 expire_in: 1 week
116 116
117 117
118 118 # build linux wheel for amd64
119 119 build-c-wheel:
120 120 extends: .build-wheel
121 121 variables:
122 122 WHEEL_TYPE: "c"
123 123 parallel:
124 124 matrix:
125 125 - BUILD_PY_ID:
126 126 - cp38-cp38
127 127 - cp39-cp39
128 128 - cp310-cp310
129 129 - cp311-cp311
130 130 - cp312-cp312
131 131 - cp313-cp313
132 132
133 trigger-wheel-musl:
134 extends: .trigger
135 stage: build
136 rules:
137 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
138 when: never
139 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
140 when: manual
141 allow_failure: true
142 133
143 build-c-wheel-musl:
144 extends: build-c-wheel
145 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0"
146 rules:
147 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
148 needs:
149 - trigger-nightly-build
150 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
151 needs:
152 - "trigger-wheel-musl"
153
154 trigger-wheel-i686:
155 extends: .trigger
156 stage: build
157 rules:
158 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
159 when: never
160 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
161 when: manual
162 allow_failure: true
163
164 build-c-wheel-i686:
165 extends: build-c-wheel
166 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0"
167 rules:
168 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
169 needs:
170 - trigger-nightly-build
171 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
172 needs:
173 - "trigger-wheel-i686"
174
175 trigger-wheel-i686-musl:
134 .wheel-trigger:
176 135 extends: .trigger
177 136 stage: build
178 137 rules:
179 138 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
180 139 when: never
181 140 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
182 141 when: manual
183 142 allow_failure: true
184 143
185 build-c-wheel-i686-musl:
144 .extra-c-wheel:
186 145 extends: build-c-wheel
187 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0"
188 146 rules:
189 147 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
190 148 needs:
191 149 - trigger-nightly-build
192 150 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
193 151 needs:
194 - "trigger-wheel-i686-musl"
152 - "trigger-wheel-musl"
153
154 trigger-wheel-musl:
155 extends: .wheel-trigger
156
157 build-c-wheel-musl:
158 extends: .extra-c-wheel
159 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0"
160
161 trigger-wheel-i686:
162 extends: .wheel-trigger
163
164 build-c-wheel-i686:
165 extends: .extra-c-wheel
166 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0"
167
168 trigger-wheel-i686-musl:
169 extends: .wheel-trigger
170
171 build-c-wheel-i686-musl:
172 extends: .extra-c-wheel
173 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0"
195 174
196 175 trigger-wheel-arm64:
197 extends: .trigger
198 stage: build
199 rules:
200 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
201 when: never
202 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
203 when: manual
204 allow_failure: true
176 extends: .wheel-trigger
205 177
206 178 build-c-wheel-arm64:
207 extends: build-c-wheel
179 extends: .extra-c-wheel
208 180 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-c:v3.0"
209 181 tags:
210 182 - arm64
211 rules:
212 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
213 needs:
214 - trigger-nightly-build
215 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
216 needs:
217 - "trigger-wheel-arm64"
218 183
219 184 trigger-wheel-arm64-musl:
220 extends: .trigger
221 stage: build
222 rules:
223 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
224 when: never
225 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
226 when: manual
227 allow_failure: true
185 extends: .wheel-trigger
228 186
229 187 build-c-wheel-arm64-musl:
230 extends: build-c-wheel
188 extends: .extra-c-wheel
231 189 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-musl-c:v3.0"
232 190 tags:
233 191 - arm64
234 rules:
235 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
236 needs:
237 - trigger-nightly-build
238 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
239 needs:
240 - "trigger-wheel-arm64-musl"
241 192
242 193 .runtests:
243 194 extends: .all
244 195 stage: tests
245 196 variables:
246 197 SHOW_VERSION_OF: "$PYTHON"
247 198 TEST_HGTESTS_ALLOW_NETIO: "0"
248 199 FILTER: ""
249 200 FLAVOR: ""
250 201 RUNTEST_ARGS: ""
251 202 # The runner made a clone as root.
252 203 # We make a new clone owned by user used to run the step.
253 204 before_script:
254 205 - echo "python used, $PYTHON"
255 206 - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
256 207 - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers
257 208 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
258 209 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
259 210 - cd "${TMP_WORK_DIR}"/mercurial-ci/
260 211 - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
261 212 script:
262 213 - echo "$TEST_HGTESTS_ALLOW_NETIO"
263 214 - echo "$RUNTEST_ARGS"
264 215 - echo "$FILTER"
265 216 - echo "$FLAVOR"
266 217 - echo "$WHEEL_TYPE"
267 218 - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID`
268 219 - PORT_ARG="--port $PORT_START"
269 220 - echo $PORT_ARG
270 221 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
271 222 - echo $PLATFORM
272 223 - WHEEL_ARG=""
273 224 - SHARDING_ARGS=""
274 225 - if test -n "$WHEEL_TYPE"; then
275 226 PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
276 227 echo "$PY_TAG";
277 228 test -n "PY_TAG";
278 229 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$PLATFORM/$WHEEL_TYPE/$PY_TAG/*.whl`";
279 230 test -n "$WHEEL";
280 231 echo installing from $WHEEL;
281 232 WHEEL_ARG="--hg-wheel $WHEEL";
282 233 echo disabling flavor as this is currently incompatible with '"--hg-wheel"';
283 234 FLAVOR="";
284 235 else
285 236 echo installing from source;
286 237 fi;
287 238 - if [ -n "$CI_NODE_INDEX" ]; then
288 239 echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]";
289 240 SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL";
290 241 echo "sharding... $SHARDING_ARGS";
291 242 fi
292 243 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
293 244 "$PYTHON" tests/run-tests.py
294 245 --color=always
295 246 --tail-report
296 247 $PORT_ARG
297 248 $WHEEL_ARG
298 249 $FLAVOR
299 250 $SHARDING_ARGS
300 251 $FILTER
301 252 $RUNTEST_ARGS;
302 253
303 254 checks:
304 255 extends: .runtests
305 256 stage: checks
306 257 variables:
307 258 SHOW_VERSION_OF: "$PYTHON black clang-format"
308 259 RUNTEST_ARGS: "--time"
309 260 FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
310 261 CI_CLEVER_CLOUD_FLAVOR: S
311 262
312 263 rust-cargo-test:
313 264 extends: .all
314 265 stage: checks
315 266 script:
316 267 - make rust-tests
317 268 - make cargo-clippy
318 269 variables:
319 270 CI_CLEVER_CLOUD_FLAVOR: S
320 271
321 272 .runtests-no-check:
322 273 extends: .runtests
323 274 variables:
324 275 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
325 276 TEST_HGTESTS_ALLOW_NETIO: "1"
326 277
327 278 .test-c:
328 279 extends: .runtests-no-check
329 280 variables:
330 281 FLAVOR: "--no-rust"
331 282
332 283 test-c:
333 284 extends: .test-c
334 285 needs:
335 286 - job: build-c-wheel
336 287 parallel:
337 288 matrix:
338 289 - BUILD_PY_ID: "cp311-cp311"
339 290 variables:
340 291 WHEEL_TYPE: "c"
341 292
342 293 test-pure:
343 294 extends: .runtests-no-check
344 295 variables:
345 296 FLAVOR: "--pure"
346 297
347 298 test-rust:
348 299 extends: .runtests-no-check
349 300 variables:
350 301 HGWITHRUSTEXT: "cpython"
351 302 FLAVOR: "--rust"
352 303
353 304 test-rhg:
354 305 extends: .runtests-no-check
355 306 variables:
356 307 HGWITHRUSTEXT: "cpython"
357 308 FLAVOR: "--rust --rhg"
358 309
359 310 test-chg:
360 311 extends: .runtests-no-check
361 312 variables:
362 313 FLAVOR: "--chg"
363 314
364 315
365 316 trigger-pycompat:
366 317 extends: .trigger
367 318 stage: py-version-compat
368 319 rules:
369 320 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
370 321 when: on_success
371 322 needs:
372 323 - trigger-nightly-build
373 324 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
374 325 when: manual
375 326 allow_failure: true
376 327
377 328 .test-c-pycompat:
378 329 extends: .test-c
379 330 stage: py-version-compat
380 331 variables:
381 332 WHEEL_TYPE: "c"
382 333
383 334 # note: we should probably get a full matrix for flavor Γ— py-version, but this
384 335 # is a simple start to be able to check if we break the lowest supported
385 336 # version (and 3.12 have been giving us various troubles)
386 337 test-3.8-c:
387 338 extends: .test-c-pycompat
388 339 variables:
389 340 PYTHON: python3.8
390 341 needs:
391 342 - job: trigger-pycompat
392 343 - job: build-c-wheel
393 344 parallel:
394 345 matrix:
395 346 - BUILD_PY_ID: "cp38-cp38"
396 347
397 348 test-3.12-c:
398 349 extends: .test-c-pycompat
399 350 variables:
400 351 PYTHON: python3.12
401 352 needs:
402 353 - job: trigger-pycompat
403 354 - job: build-c-wheel
404 355 parallel:
405 356 matrix:
406 357 - BUILD_PY_ID: "cp312-cp312"
407 358
408 359 test-3.12-rust:
409 360 extends: test-rust
410 361 stage: py-version-compat
411 362 needs:
412 363 - trigger-pycompat
413 364 variables:
414 365 PYTHON: python3.12
415 366
416 367 test-3.13-c:
417 368 extends: .test-c-pycompat
418 369 variables:
419 370 PYTHON: python3.13
420 371 needs:
421 372 - job: trigger-pycompat
422 373 - job: build-c-wheel
423 374 parallel:
424 375 matrix:
425 376 - BUILD_PY_ID: "cp313-cp313"
426 377
427 378 test-3.13-rust:
428 379 extends: test-rust
429 380 stage: py-version-compat
430 381 needs:
431 382 - trigger-pycompat
432 383 variables:
433 384 PYTHON: python3.13
434 385
435 386 check-pytype:
436 387 extends: test-rust
437 388 stage: checks
438 389 before_script:
439 390 - 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"
440 391 - echo "PATH, $PATH"
441 392 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
442 393 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
443 394 - cd "${TMP_WORK_DIR}"/mercurial-ci/
444 395 - make local PYTHON=$PYTHON
445 396 - ./contrib/setup-pytype.sh
446 397 script:
447 398 - echo "Entering script section"
448 399 - bash contrib/check-pytype.sh
449 400
450 401 # `sh.exe --login` sets a couple of extra environment variables that are defined
451 402 # in the MinGW shell, but switches CWD to /home/$username. The previous value
452 403 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
453 404 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
454 405 # that satisfies the various shebang lines and delegates to `py -3`.
455 406
456 407 .windows:
457 408 extends: .all
458 409 when: manual # we don't have any Windows runners anymore at the moment
459 410 tags:
460 411 - windows
461 412 before_script:
462 413 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt'
463 414 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
464 415 variables:
465 416 PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
466 417
467 418 # a dummy job that only serve to trigger the wider windows build
468 419 trigger-wheel-windows:
469 420 extends: .trigger
470 421 stage: build
471 422 rules:
472 423 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
473 424 when: never
474 425 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
475 426 when: manual
476 427 allow_failure: true
477 428
478 429 build-c-wheel-windows:
479 430 extends: .windows
480 431 stage: build
481 432 # wait for someone to click on "trigger-wheel-windows"
482 433 when: on_success
483 434 needs:
484 435 rules:
485 436 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
486 437 needs:
487 438 - trigger-nightly-build
488 439 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
489 440 needs:
490 441 - "trigger-wheel-windows"
491 442 variables:
492 443 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
493 444 script:
494 445 - echo "Entering script section"
495 446 - echo "python used, $Env:PYTHON"
496 447 - Invoke-Expression "$Env:PYTHON -V"
497 448 - echo "$Env:RUNTEST_ARGS"
498 449 - echo "$Env:TMP"
499 450 - echo "$Env:TEMP"
500 451 - "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32"
501 452 artifacts:
502 453 paths:
503 454 - wheels
504 455 expire_in: 1 week
505 456 parallel:
506 457 matrix:
507 458 # "cp39" is first as it unlock the tests
508 459 - CIBW_BUILD:
509 460 - "cp39-*"
510 461 - "cp38-*"
511 462 - "cp310-*"
512 463 - "cp311-*"
513 464 - "cp312-*"
514 465 - "cp313-*"
515 466 CIBW_ARCHS:
516 467 - "AMD64"
517 468 - "x86"
518 469 - CIBW_BUILD:
519 470 - "cp311-*"
520 471 - "cp312-*"
521 472 - "cp313-*"
522 473 CIBW_ARCHS:
523 474 - "ARM64"
524 475
525 476
526 477 .windows-runtests:
527 478 extends: .windows
528 479 stage: platform-compat
529 480 # the UX for manual parallel jobs is quite awful, and the job que depends
530 481 # upon are manual anyway, so we can make this start automatically once the
531 482 # associated wheel is ready.
532 483 when: on_success
533 484 parallel: 20
534 485 script:
535 486 - echo "Entering script section"
536 487 - echo "python used, $Env:PYTHON"
537 488 - Invoke-Expression "$Env:PYTHON -V"
538 489 - echo "$Env:HGTESTS_ALLOW_NETIO"
539 490 - echo "$Env:WHEEL_ARG"
540 491 - echo "$Env:FLAVOR"
541 492 - echo "$Env:FILTER"
542 493 - echo "$Env:RUNTEST_ARGS"
543 494 - echo "$Env:TMP"
544 495 - echo "$Env:TEMP"
545 496 # This test is hanging the worker and not that important, so lets skip
546 497 # it for now
547 498 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt'
548 499
549 500 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe
550 501 --login -c 'cd "$OLDPWD"
551 502 && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
552 503 $PYTHON tests/run-tests.py
553 504 --color=always
554 505 --tail-report
555 506 $WHEEL_ARG
556 507 $FLAVOR
557 508 --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID`
558 509 --shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL
559 510 $FILTER
560 511 $RUNTEST_ARGS;
561 512 '
562 513 variables:
563 514 WHEEL_ARG: ""
564 515 RUNTEST_ARGS: ""
565 516 FLAVOR: ""
566 517 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt"
567 518
568 519 windows:
569 520 extends: .windows-runtests
570 521 variables:
571 522 RUNTEST_ARGS: ""
572 523 WHEEL_ARG: "--hg-wheel wheels/win32/mercurial-*-cp39-cp39-win_amd64.whl"
573 524 needs:
574 525 - job: build-c-wheel-windows
575 526 parallel:
576 527 matrix:
577 528 - CIBW_BUILD: "cp39-*"
578 529 CIBW_ARCHS: "AMD64"
579 530
580 531 windows-pyox:
581 532 extends: .windows-runtests
582 533 when: manual # pyoxidizer builds seem broken with --no-use-pep517
583 534 variables:
584 535 FLAVOR: "--pyoxidized"
585 536
586 537 macos:
587 538 extends: .test-c
588 539 stage: platform-compat
589 540 # run the test in multiple shard to help spread the load between concurrent
590 541 # MR as the macos runner is a shell runner there is not startup overhead
591 542 # for tests.
592 543 parallel: 10
593 544 tags:
594 545 - macos
595 546 variables:
596 547 WHEEL_TYPE: "c"
597 548 needs:
598 549 - build-c-wheel-macos
599 550
600 551 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
601 552 # this is the only one we need to test. However testing that build work on all
602 553 # version is useful and match what we do with Linux.
603 554 #
604 555 # CIBW_SKIP is set globally at the start of the file. See comment there.
605 556 #
606 557 # The weird directory structure match the one we use for Linux to deal with the
607 558 # multiple jobs. (all this might be unnecessary)
608 559 build-c-wheel-macos:
609 560 rules:
610 561 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
611 562 needs:
612 563 - trigger-nightly-build
613 564 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
614 565 when: manual # avoid overloading the CI by default
615 566 allow_failure: true
616 567 stage: build
617 568 tags:
618 569 - macos
619 570 variables:
620 571 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
621 572 script:
622 573 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
623 574 - rm -rf tmp-wheels
624 575 - cibuildwheel --output-dir tmp-wheels/
625 576 - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
626 577 mkdir -p wheels/$PLATFORM/c/$py_version/;
627 578 mv tmp-wheels/*$py_version*.whl wheels/$PLATFORM/c/$py_version/;
628 579 done
629 580 - rm -rf tmp-wheels
630 581 artifacts:
631 582 paths:
632 583 - wheels
633 584 expire_in: 1 week
634 585
635 586
636 587 .nightly_build_step:
637 588 extends: .all
638 589 stage: upload
639 590 rules:
640 591 - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH'
641 592 # note that at the time of writing this, this job depends on multiple
642 593 # manual one. So it will not run by default, but will automatically run
643 594 # if the manual jobs are triggered.
644 595 #
645 596 # Also beware that "on_success" will ignore failure of manual test we
646 597 # directly depends on. This currently relevant for the "test-3.x-c"
647 598 # tests.
648 599 when: on_success
649 600 - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC'
650 601 when: never
651 602
652 603 # a dummy job that gather greatly parallel object into one.
653 604 #
654 605 # It exists because gitlab-ci has a "50 jobs" limit on "needs" entries.
655 606 # (yes, this is sad)
656 607 #
657 608 .sink:
658 609 extends:
659 610 - .nightly_build_step
660 611 - .dummy
661 612
662 613 test-result-linux:
663 614 extends: .sink
664 615 needs:
665 616 - test-c
666 617 - test-3.8-c
667 618 - test-3.12-c
668 619 - test-3.13-c
669 620
670 621 test-result-macos:
671 622 extends: .sink
672 623 needs:
673 624 - macos
674 625
675 626 test-result-windows:
676 627 extends: .sink
677 628 needs:
678 629 - windows
679 630
680 631 wheel-result-linux:
681 632 extends: .sink
682 633 needs:
683 634 - build-c-wheel
684 635 - build-c-wheel-musl
685 636 - build-c-wheel-i686
686 637 - build-c-wheel-i686-musl
687 638 - build-c-wheel-arm64
688 639 - build-c-wheel-arm64-musl
689 640 artifacts:
690 641 paths:
691 642 - wheels
692 643 expire_in: 1 week
693 644
694 645 wheel-result-windows:
695 646 extends: .sink
696 647 needs:
697 648 - build-c-wheel-windows
698 649 artifacts:
699 650 paths:
700 651 - wheels
701 652 expire_in: 1 week
702 653
703 654 # Upload nightly build wheel on the heptapod registry on test success
704 655 #
705 656 # At the time this task is added, since the mac wheels are built on shell
706 657 # runner, those nightly are not be considered fully secured.
707 658 #
708 659 # In addition, since any job can upload package, pretty much anyone with CI
709 660 # access can upload anything pretending to be any version. To fix it we would
710 661 # have to prevent the CI token to upload to the registry and have dedicated
711 662 # credential accessible only from protected branches.
712 663 upload-wheel-nightly:
713 664 extends: .nightly_build_step
714 665 image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0"
715 666 # because we don't want to upload only half of a wheel
716 667 interruptible: false
717 668 needs:
718 669 - wheel-result-linux
719 670 - wheel-result-windows
720 671 - build-c-wheel-macos
721 672 - test-result-linux
722 673 - test-result-macos
723 674 - test-result-windows
724 675 # It would be nice to be able to restrict that a bit to protected branch only
725 676 variables:
726 677 TWINE_USERNAME: gitlab-ci-token
727 678 TWINE_PASSWORD: $CI_JOB_TOKEN
728 679 script:
729 680 - twine
730 681 upload
731 682 --verbose
732 683 --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
733 684 wheels/*/*/*/*.whl
734 685 wheels/*/*.whl
General Comments 0
You need to be logged in to leave comments. Login now