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