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