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