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