Show More
@@ -1,376 +1,421 | |||
|
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 | 39 | # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither |
|
40 | 40 | # needed nor working. |
|
41 | 41 | CIBW_SKIP: "pp*" |
|
42 | 42 | |
|
43 | 43 | .all: |
|
44 | 44 | # help changing all job at once when debugging |
|
45 | 45 | when: on_success |
|
46 | 46 | # make sure jobs from later steps does not wait for anything implicit before |
|
47 | 47 | # starting. |
|
48 | 48 | needs: [] |
|
49 | 49 | |
|
50 | 50 | .build-wheel: |
|
51 | 51 | extends: .all |
|
52 | 52 | image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0" |
|
53 | 53 | stage: build |
|
54 | 54 | variables: |
|
55 | 55 | WHEEL_TYPE: "" |
|
56 | 56 | FLAVOR: "" |
|
57 | 57 | MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" |
|
58 | 58 | CI_CLEVER_CLOUD_FLAVOR: "XS" |
|
59 | 59 | before_script: |
|
60 | 60 | - echo $WHEEL_TYPE |
|
61 | 61 | - test -n "$WHEEL_TYPE" |
|
62 | 62 | - echo $FLAVOR |
|
63 | 63 | - mkdir -p wheels/$WHEEL_TYPE/$BUILD_PY_ID |
|
64 | 64 | script: |
|
65 | 65 | - /opt/python/$BUILD_PY_ID/bin/python setup.py bdist_wheel --dist-dir tmp-wheelhouse |
|
66 | 66 | - auditwheel repair tmp-wheelhouse/*.whl -w wheels/$WHEEL_TYPE/$BUILD_PY_ID |
|
67 | 67 | artifacts: |
|
68 | 68 | paths: |
|
69 | 69 | - wheels/$WHEEL_TYPE/$BUILD_PY_ID |
|
70 | 70 | expire_in: 1 week |
|
71 | 71 | |
|
72 | 72 | build-c-wheel: |
|
73 | 73 | extends: .build-wheel |
|
74 | 74 | variables: |
|
75 | 75 | WHEEL_TYPE: "c" |
|
76 | 76 | parallel: |
|
77 | 77 | matrix: |
|
78 | 78 | - BUILD_PY_ID: |
|
79 | 79 | - cp38-cp38 |
|
80 | 80 | - cp39-cp39 |
|
81 | 81 | - cp310-cp310 |
|
82 | 82 | - cp311-cp311 |
|
83 | 83 | - cp312-cp312 |
|
84 | 84 | - cp313-cp313 |
|
85 | 85 | |
|
86 | 86 | .runtests: |
|
87 | 87 | extends: .all |
|
88 | 88 | stage: tests |
|
89 | 89 | variables: |
|
90 | 90 | SHOW_VERSION_OF: "$PYTHON" |
|
91 | 91 | TEST_HGTESTS_ALLOW_NETIO: "0" |
|
92 | 92 | FILTER: "" |
|
93 | 93 | FLAVOR: "" |
|
94 | 94 | RUNTEST_ARGS: "" |
|
95 | 95 | # The runner made a clone as root. |
|
96 | 96 | # We make a new clone owned by user used to run the step. |
|
97 | 97 | before_script: |
|
98 | 98 | - echo "python used, $PYTHON" |
|
99 | 99 | - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done |
|
100 | 100 | - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers |
|
101 | 101 | - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no |
|
102 | 102 | - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
|
103 | 103 | - cd "${TMP_WORK_DIR}"/mercurial-ci/ |
|
104 | 104 | - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt |
|
105 | 105 | script: |
|
106 | 106 | - echo "$TEST_HGTESTS_ALLOW_NETIO" |
|
107 | 107 | - echo "$RUNTEST_ARGS" |
|
108 | 108 | - echo "$FILTER" |
|
109 | 109 | - echo "$FLAVOR" |
|
110 | 110 | - echo "$WHEEL_TYPE" |
|
111 | 111 | - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID` |
|
112 | 112 | - PORT_ARG="--port $PORT_START" |
|
113 | 113 | - echo $PORT_ARG |
|
114 | 114 | - WHEEL_ARG="" |
|
115 | 115 | - SHARDING_ARGS="" |
|
116 | 116 | - if test -n "$WHEEL_TYPE"; then |
|
117 | 117 | PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`; |
|
118 | 118 | echo "$PY_TAG"; |
|
119 | 119 | test -n "PY_TAG"; |
|
120 | 120 | WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/$PY_TAG/*.whl`"; |
|
121 | 121 | test -n "$WHEEL"; |
|
122 | 122 | echo installing from $WHEEL; |
|
123 | 123 | WHEEL_ARG="--hg-wheel $WHEEL"; |
|
124 | 124 | echo disabling flavor as this is currently incompatible with '"--hg-wheel"'; |
|
125 | 125 | FLAVOR=""; |
|
126 | 126 | else |
|
127 | 127 | echo installing from source; |
|
128 | 128 | fi; |
|
129 | 129 | - if [ -n "$CI_NODE_INDEX" ]; then |
|
130 | 130 | echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]"; |
|
131 | 131 | SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL"; |
|
132 | 132 | echo "sharding... $SHARDING_ARGS"; |
|
133 | 133 | fi |
|
134 | 134 | - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" |
|
135 | 135 | "$PYTHON" tests/run-tests.py |
|
136 | 136 | --color=always |
|
137 | 137 | $PORT_ARG |
|
138 | 138 | $WHEEL_ARG |
|
139 | 139 | $FLAVOR |
|
140 | 140 | $SHARDING_ARGS |
|
141 | 141 | $FILTER |
|
142 | 142 | $RUNTEST_ARGS; |
|
143 | 143 | |
|
144 | 144 | checks: |
|
145 | 145 | extends: .runtests |
|
146 | 146 | stage: checks |
|
147 | 147 | variables: |
|
148 | 148 | SHOW_VERSION_OF: "$PYTHON black clang-format" |
|
149 | 149 | RUNTEST_ARGS: "--time" |
|
150 | 150 | FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt" |
|
151 | 151 | CI_CLEVER_CLOUD_FLAVOR: S |
|
152 | 152 | |
|
153 | 153 | rust-cargo-test: |
|
154 | 154 | extends: .all |
|
155 | 155 | stage: checks |
|
156 | 156 | script: |
|
157 | 157 | - make rust-tests |
|
158 | 158 | - make cargo-clippy |
|
159 | 159 | variables: |
|
160 | 160 | CI_CLEVER_CLOUD_FLAVOR: S |
|
161 | 161 | |
|
162 | 162 | .runtests-no-check: |
|
163 | 163 | extends: .runtests |
|
164 | 164 | variables: |
|
165 | 165 | FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt" |
|
166 | 166 | TEST_HGTESTS_ALLOW_NETIO: "1" |
|
167 | 167 | |
|
168 | 168 | .test-c: |
|
169 | 169 | extends: .runtests-no-check |
|
170 | 170 | variables: |
|
171 | 171 | FLAVOR: "--no-rust" |
|
172 | 172 | |
|
173 | 173 | test-c: |
|
174 | 174 | extends: .test-c |
|
175 | 175 | needs: |
|
176 | 176 | - job: build-c-wheel |
|
177 | 177 | parallel: |
|
178 | 178 | matrix: |
|
179 | 179 | - BUILD_PY_ID: "cp311-cp311" |
|
180 | 180 | variables: |
|
181 | 181 | WHEEL_TYPE: "c" |
|
182 | 182 | |
|
183 | 183 | test-pure: |
|
184 | 184 | extends: .runtests-no-check |
|
185 | 185 | variables: |
|
186 | 186 | FLAVOR: "--pure" |
|
187 | 187 | |
|
188 | 188 | test-rust: |
|
189 | 189 | extends: .runtests-no-check |
|
190 | 190 | variables: |
|
191 | 191 | HGWITHRUSTEXT: "cpython" |
|
192 | 192 | FLAVOR: "--rust" |
|
193 | 193 | |
|
194 | 194 | test-rhg: |
|
195 | 195 | extends: .runtests-no-check |
|
196 | 196 | variables: |
|
197 | 197 | HGWITHRUSTEXT: "cpython" |
|
198 | 198 | FLAVOR: "--rust --rhg" |
|
199 | 199 | |
|
200 | 200 | test-chg: |
|
201 | 201 | extends: .runtests-no-check |
|
202 | 202 | variables: |
|
203 | 203 | FLAVOR: "--chg" |
|
204 | 204 | |
|
205 | 205 | # note: we should probably get a full matrix for flavor Γ py-version, but this |
|
206 | 206 | # is a simple start to be able to check if we break the lowest supported |
|
207 | 207 | # version (and 3.12 have been giving us various troubles) |
|
208 | 208 | test-3.8-c: |
|
209 | 209 | extends: .test-c |
|
210 | 210 | stage: py-version-compat |
|
211 | 211 | when: manual # avoid overloading the CI by default |
|
212 | 212 | variables: |
|
213 | 213 | PYTHON: python3.8 |
|
214 | 214 | WHEEL_TYPE: "c" |
|
215 | 215 | needs: |
|
216 | 216 | - job: build-c-wheel |
|
217 | 217 | parallel: |
|
218 | 218 | matrix: |
|
219 | 219 | - BUILD_PY_ID: "cp38-cp38" |
|
220 | 220 | |
|
221 | 221 | test-3.12-c: |
|
222 | 222 | extends: .test-c |
|
223 | 223 | stage: py-version-compat |
|
224 | 224 | when: manual # avoid overloading the CI by default |
|
225 | 225 | variables: |
|
226 | 226 | PYTHON: python3.12 |
|
227 | 227 | WHEEL_TYPE: "c" |
|
228 | 228 | needs: |
|
229 | 229 | - job: build-c-wheel |
|
230 | 230 | parallel: |
|
231 | 231 | matrix: |
|
232 | 232 | - BUILD_PY_ID: "cp312-cp312" |
|
233 | 233 | |
|
234 | 234 | test-3.12-rust: |
|
235 | 235 | extends: test-rust |
|
236 | 236 | stage: py-version-compat |
|
237 | 237 | when: manual # avoid overloading the CI by default |
|
238 | 238 | variables: |
|
239 | 239 | PYTHON: python3.12 |
|
240 | 240 | |
|
241 | 241 | test-3.13-c: |
|
242 | 242 | extends: .test-c |
|
243 | 243 | stage: py-version-compat |
|
244 | 244 | when: manual # avoid overloading the CI by default |
|
245 | 245 | variables: |
|
246 | 246 | PYTHON: python3.13 |
|
247 | 247 | WHEEL_TYPE: "c" |
|
248 | 248 | needs: |
|
249 | 249 | - job: build-c-wheel |
|
250 | 250 | parallel: |
|
251 | 251 | matrix: |
|
252 | 252 | - BUILD_PY_ID: "cp313-cp313" |
|
253 | 253 | |
|
254 | 254 | test-3.13-rust: |
|
255 | 255 | extends: test-rust |
|
256 | 256 | stage: py-version-compat |
|
257 | 257 | when: manual # avoid overloading the CI by default |
|
258 | 258 | variables: |
|
259 | 259 | PYTHON: python3.13 |
|
260 | 260 | |
|
261 | 261 | check-pytype: |
|
262 | 262 | extends: test-rust |
|
263 | 263 | stage: checks |
|
264 | 264 | before_script: |
|
265 | 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" |
|
266 | 266 | - echo "PATH, $PATH" |
|
267 | 267 | - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no |
|
268 | 268 | - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
|
269 | 269 | - cd "${TMP_WORK_DIR}"/mercurial-ci/ |
|
270 | 270 | - make local PYTHON=$PYTHON |
|
271 | 271 | - ./contrib/setup-pytype.sh |
|
272 | 272 | script: |
|
273 | 273 | - echo "Entering script section" |
|
274 | 274 | - sh contrib/check-pytype.sh |
|
275 | 275 | |
|
276 | 276 | # `sh.exe --login` sets a couple of extra environment variables that are defined |
|
277 | 277 | # in the MinGW shell, but switches CWD to /home/$username. The previous value |
|
278 | 278 | # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running |
|
279 | 279 | # run-tests.py- it is needed to make run-tests.py generate a `python3` script |
|
280 | 280 | # that satisfies the various shebang lines and delegates to `py -3`. |
|
281 | 281 | |
|
282 | 282 | .windows: |
|
283 | 283 | extends: .all |
|
284 | 284 | when: manual # we don't have any Windows runners anymore at the moment |
|
285 | 285 | tags: |
|
286 | 286 | - windows |
|
287 | 287 | before_script: |
|
288 | 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' |
|
289 | 289 | # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 |
|
290 | 290 | variables: |
|
291 | 291 | PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe |
|
292 | 292 | |
|
293 | ||
|
294 | # a dummy job that only serve to trigger the wider windows build | |
|
295 | trigger-wheel-windows: | |
|
296 | extends: .all | |
|
297 | # smallest I know of | |
|
298 | image: busybox | |
|
299 | when: manual | |
|
300 | stage: build | |
|
301 | variables: | |
|
302 | GIT_STRATEGY: none | |
|
303 | CI_CLEVER_CLOUD_FLAVOR: "XS" | |
|
304 | script: | |
|
305 | - echo 'let us build some wheels.' | |
|
306 | ||
|
307 | build-c-wheel-windows: | |
|
308 | extends: .windows | |
|
309 | stage: build | |
|
310 | # wait for someone to click on "trigger-wheel-windows" | |
|
311 | when: on_success | |
|
312 | needs: | |
|
313 | - "trigger-wheel-windows" | |
|
314 | script: | |
|
315 | - echo "Entering script section" | |
|
316 | - echo "python used, $Env:PYTHON" | |
|
317 | - Invoke-Expression "$Env:PYTHON -V" | |
|
318 | - echo "$Env:RUNTEST_ARGS" | |
|
319 | - echo "$Env:TMP" | |
|
320 | - echo "$Env:TEMP" | |
|
321 | - "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32" | |
|
322 | artifacts: | |
|
323 | paths: | |
|
324 | - wheels | |
|
325 | expire_in: 1 week | |
|
326 | parallel: | |
|
327 | matrix: | |
|
328 | # "cp39" is first as it unlock the tests | |
|
329 | - CIBW_BUILD: | |
|
330 | - "cp39-*" | |
|
331 | - "cp38-*" | |
|
332 | - "cp310-*" | |
|
333 | - "cp311-*" | |
|
334 | - "cp312-*" | |
|
335 | - "cp313-*" | |
|
336 | ||
|
337 | ||
|
293 | 338 | .windows-runtests: |
|
294 | 339 | extends: .windows |
|
295 | 340 | stage: platform-compat |
|
296 | 341 | script: |
|
297 | 342 | - echo "Entering script section" |
|
298 | 343 | - echo "python used, $Env:PYTHON" |
|
299 | 344 | - Invoke-Expression "$Env:PYTHON -V" |
|
300 | 345 | - echo "$Env:HGTESTS_ALLOW_NETIO" |
|
301 | 346 | - echo "$Env:FLAVOR" |
|
302 | 347 | - echo "$Env:FILTER" |
|
303 | 348 | - echo "$Env:RUNTEST_ARGS" |
|
304 | 349 | - echo "$Env:TMP" |
|
305 | 350 | - echo "$Env:TEMP" |
|
306 | 351 | # This test is hanging the worker and not that important, so lets skip |
|
307 | 352 | # it for now |
|
308 | 353 | - C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt' |
|
309 | 354 | |
|
310 | 355 | - C:/hgdev/MinGW/msys/1.0/bin/sh.exe |
|
311 | 356 | --login -c 'cd "$OLDPWD" |
|
312 | 357 | && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" |
|
313 | 358 | $PYTHON tests/run-tests.py |
|
314 | 359 | --color=always |
|
315 | 360 | $FLAVOR |
|
316 | 361 | --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID` |
|
317 | 362 | $FILTER |
|
318 | 363 | $RUNTEST_ARGS; |
|
319 | 364 | ' |
|
320 | 365 | variables: |
|
321 | 366 | RUNTEST_ARGS: "" |
|
322 | 367 | FLAVOR: "" |
|
323 | 368 | FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt" |
|
324 | 369 | |
|
325 | 370 | windows: |
|
326 | 371 | extends: .windows-runtests |
|
327 | 372 | variables: |
|
328 | 373 | RUNTEST_ARGS: "-j 8" |
|
329 | 374 | |
|
330 | 375 | windows-pyox: |
|
331 | 376 | extends: .windows-runtests |
|
332 | 377 | when: manual # pyoxidizer builds seem broken with --no-use-pep517 |
|
333 | 378 | variables: |
|
334 | 379 | FLAVOR: "--pyoxidized" |
|
335 | 380 | |
|
336 | 381 | macos: |
|
337 | 382 | extends: .test-c |
|
338 | 383 | stage: platform-compat |
|
339 | 384 | # run the test in multiple shard to help spread the load between concurrent |
|
340 | 385 | # MR as the macos runner is a shell runner there is not startup overhead |
|
341 | 386 | # for tests. |
|
342 | 387 | parallel: 10 |
|
343 | 388 | tags: |
|
344 | 389 | - macos |
|
345 | 390 | variables: |
|
346 | 391 | WHEEL_TYPE: "c" |
|
347 | 392 | needs: |
|
348 | 393 | - build-c-wheel-macos |
|
349 | 394 | |
|
350 | 395 | # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as |
|
351 | 396 | # this is the only one we need to test. However testing that build work on all |
|
352 | 397 | # version is useful and match what we do with Linux. |
|
353 | 398 | # |
|
354 | 399 | # CIBW_SKIP is set globally at the start of the file. See comment there. |
|
355 | 400 | # |
|
356 | 401 | # The weird directory structure match the one we use for Linux to deal with the |
|
357 | 402 | # multiple jobs. (all this might be unnecessary) |
|
358 | 403 | build-c-wheel-macos: |
|
359 | 404 | when: manual # avoid overloading the CI by default |
|
360 | 405 | stage: build |
|
361 | 406 | tags: |
|
362 | 407 | - macos |
|
363 | 408 | variables: |
|
364 | 409 | MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" |
|
365 | 410 | script: |
|
366 | 411 | - rm -rf tmp-wheels |
|
367 | 412 | - cibuildwheel --output-dir tmp-wheels/ |
|
368 | 413 | - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do |
|
369 | 414 | mkdir -p wheels/c/$py_version/; |
|
370 | 415 | mv tmp-wheels/*$py_version*.whl wheels/c/$py_version/; |
|
371 | 416 | done |
|
372 | 417 | - rm -rf tmp-wheels |
|
373 | 418 | artifacts: |
|
374 | 419 | paths: |
|
375 | 420 | - wheels |
|
376 | 421 | expire_in: 1 week |
General Comments 0
You need to be logged in to leave comments.
Login now