##// END OF EJS Templates
wheel: build mac os wheel through the CI...
marmoute -
r53099:97d86d5b stable
parent child Browse files
Show More
@@ -1,293 +1,319
1 1 # Don't run pipelines on branch "merge", since we're fast-forward only.
2 2 # Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
3 3 # `branch/stable`), but the hash hasn't changed. There is no reason to
4 4 # re-run the CI in our case, since we haven't built up any specific automation.
5 5 # Right now it's just wasted CI and developer time.
6 6 # One can still run the pipeline manually via the web interface,
7 7 # like in the case of releases, to make *extra* sure that the actual branch
8 8 # has succeeded.
9 9 workflow:
10 10 rules:
11 11 - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
12 12 when: never
13 13 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
14 14 when: never
15 15 - if: $CI_PIPELINE_SOURCE == "push"
16 16 when: always
17 17 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
18 18 when: never
19 19 - if: $CI_COMMIT_BRANCH
20 20 when: always
21 21
22 22 stages:
23 23 - build
24 24 - checks
25 25 - tests
26 26 - platform-compat
27 27 - py-version-compat
28 28
29 29
30 30 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
31 31
32 32 variables:
33 33 PYTHON: python
34 34 HG_CI_IMAGE_TAG: "v2.1"
35 35 TEST_HGTESTS_ALLOW_NETIO: "0"
36 36 SHOW_VERSION_OF: "$PYTHON"
37 37
38 38 .all_template: &all
39 39 when: on_success
40 40 needs: []
41 41
42 42 .build-wheel: &wheel
43 43 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
44 44 <<: *all
45 45 stage: build
46 46 variables:
47 47 WHEEL_TYPE: ""
48 48 FLAVOR: ""
49 49 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
50 50 CI_CLEVER_CLOUD_FLAVOR: "XS"
51 51 before_script:
52 52 - echo $WHEEL_TYPE
53 53 - test -n "$WHEEL_TYPE"
54 54 - echo $FLAVOR
55 55 - mkdir -p wheels/$WHEEL_TYPE/$BUILD_PY_ID
56 56 script:
57 57 - /opt/python/$BUILD_PY_ID/bin/python setup.py bdist_wheel --dist-dir tmp-wheelhouse
58 58 - auditwheel repair tmp-wheelhouse/*.whl -w wheels/$WHEEL_TYPE/$BUILD_PY_ID
59 59 artifacts:
60 60 paths:
61 61 - wheels/$WHEEL_TYPE/$BUILD_PY_ID
62 62 expire_in: 1 week
63 63
64 64 build-c-wheel:
65 65 <<: *wheel
66 66 variables:
67 67 WHEEL_TYPE: "c"
68 68 parallel:
69 69 matrix:
70 70 - BUILD_PY_ID:
71 71 - cp38-cp38
72 72 - cp39-cp39
73 73 - cp310-cp310
74 74 - cp311-cp311
75 75 - cp312-cp312
76 76 - cp313-cp313
77 77
78 78 # TODO: We should select the wheel compatible with the python (and plateform)
79 79 # we use. This is necessary to build multiple wheel.
80 80 .runtests_template: &runtests
81 81 <<: *all
82 82 stage: tests
83 83 # The runner made a clone as root.
84 84 # We make a new clone owned by user used to run the step.
85 85 before_script:
86 86 - echo "python used, $PYTHON"
87 87 - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
88 88 - rm -rf /tmp/mercurial-ci/ # Clean slate if not using containers
89 89 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
90 90 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
91 91 - cd /tmp/mercurial-ci/
92 92 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
93 93 script:
94 94 - echo "$RUNTEST_ARGS"
95 95 - echo "$WHEEL_TYPE"
96 96 - WHEEL=""
97 97 - if test -n "$WHEEL_TYPE"; then
98 98 PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
99 99 echo "$PY_TAG";
100 100 test -n "PY_TAG";
101 101 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/$PY_TAG/*.whl`";
102 102 test -n "$WHEEL";
103 103 fi
104 104 - if test -n "$WHEEL"; then
105 105 echo installing from $WHEEL;
106 106 HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --hg-wheel $WHEEL --color=always $RUNTEST_ARGS;
107 107 else
108 108 echo installing from source;
109 109 HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS;
110 110 fi
111 111
112 112 checks:
113 113 <<: *runtests
114 114 stage: checks
115 115 variables:
116 116 SHOW_VERSION_OF: "$PYTHON black clang-format"
117 117 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
118 118 CI_CLEVER_CLOUD_FLAVOR: S
119 119
120 120 rust-cargo-test:
121 121 <<: *all
122 122 stage: checks
123 123 script:
124 124 - make rust-tests
125 125 - make cargo-clippy
126 126 variables:
127 127 CI_CLEVER_CLOUD_FLAVOR: S
128 128
129 129 .test-c: &test_c
130 130 <<: *runtests
131 131 variables:
132 132 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
133 133 TEST_HGTESTS_ALLOW_NETIO: "1"
134 134
135 135 test-c:
136 136 <<: *test_c
137 137 needs:
138 138 - job: build-c-wheel
139 139 parallel:
140 140 matrix:
141 141 - BUILD_PY_ID: "cp311-cp311"
142 142
143 143 variables:
144 144 WHEEL_TYPE: "c"
145 145 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt"
146 146 TEST_HGTESTS_ALLOW_NETIO: "1"
147 147
148 148 test-pure:
149 149 <<: *runtests
150 150 variables:
151 151 RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
152 152
153 153 test-rust: &test_rust
154 154 <<: *runtests
155 155 variables:
156 156 HGWITHRUSTEXT: cpython
157 157 RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
158 158
159 159 test-rhg:
160 160 <<: *runtests
161 161 variables:
162 162 HGWITHRUSTEXT: cpython
163 163 RUNTEST_ARGS: "--rust --rhg --blacklist /tmp/check-tests.txt"
164 164
165 165 test-chg:
166 166 <<: *runtests
167 167 variables:
168 168 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
169 169
170 170 # note: we should probably get a full matrix for flavor × py-version, but this
171 171 # is a simple start to be able to check if we break the lowest supported
172 172 # version (and 3.12 have been giving us various troubles)
173 173 test-3.8-c:
174 174 <<: *test_c
175 175 stage: py-version-compat
176 176 when: manual # avoid overloading the CI by default
177 177 variables:
178 178 PYTHON: python3.8
179 179 WHEEL_TYPE: "c"
180 180 RUNTEST_ARGS: " --blacklist /tmp/check-tests.txt"
181 181 TEST_HGTESTS_ALLOW_NETIO: "1"
182 182 needs:
183 183 - job: build-c-wheel
184 184 parallel:
185 185 matrix:
186 186 - BUILD_PY_ID: "cp38-cp38"
187 187
188 188 test-3.12-c:
189 189 <<: *test_c
190 190 stage: py-version-compat
191 191 when: manual # avoid overloading the CI by default
192 192 variables:
193 193 PYTHON: python3.12
194 194 WHEEL_TYPE: "c"
195 195 RUNTEST_ARGS: " --blacklist /tmp/check-tests.txt"
196 196 TEST_HGTESTS_ALLOW_NETIO: "1"
197 197 needs:
198 198 - job: build-c-wheel
199 199 parallel:
200 200 matrix:
201 201 - BUILD_PY_ID: "cp312-cp312"
202 202
203 203 test-3.12-rust:
204 204 <<: *test_rust
205 205 stage: py-version-compat
206 206 when: manual # avoid overloading the CI by default
207 207 variables:
208 208 PYTHON: python3.12
209 209
210 210 test-3.13-c:
211 211 <<: *test_c
212 212 stage: py-version-compat
213 213 when: manual # avoid overloading the CI by default
214 214 variables:
215 215 PYTHON: python3.13
216 216 WHEEL_TYPE: "c"
217 217 RUNTEST_ARGS: " --blacklist /tmp/check-tests.txt"
218 218 TEST_HGTESTS_ALLOW_NETIO: "1"
219 219 needs:
220 220 - job: build-c-wheel
221 221 parallel:
222 222 matrix:
223 223 - BUILD_PY_ID: "cp313-cp313"
224 224
225 225 test-3.13-rust:
226 226 <<: *test_rust
227 227 stage: py-version-compat
228 228 when: manual # avoid overloading the CI by default
229 229 variables:
230 230 PYTHON: python3.13
231 231
232 232 check-pytype:
233 233 <<: *test_rust
234 234 stage: checks
235 235 before_script:
236 236 - 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"
237 237 - echo "PATH, $PATH"
238 238 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
239 239 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
240 240 - cd /tmp/mercurial-ci/
241 241 - make local PYTHON=$PYTHON
242 242 - ./contrib/setup-pytype.sh
243 243 script:
244 244 - echo "Entering script section"
245 245 - sh contrib/check-pytype.sh
246 246
247 247 # `sh.exe --login` sets a couple of extra environment variables that are defined
248 248 # in the MinGW shell, but switches CWD to /home/$username. The previous value
249 249 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
250 250 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
251 251 # that satisfies the various shebang lines and delegates to `py -3`.
252 252 .window_runtests_template: &windows_runtests
253 253 <<: *all
254 254 when: manual # we don't have any Windows runners anymore at the moment
255 255 stage: platform-compat
256 256 before_script:
257 257 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/hgdev/tmp/check-tests.txt'
258 258 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
259 259
260 260 script:
261 261 - echo "Entering script section"
262 262 - echo "python used, $Env:PYTHON"
263 263 - Invoke-Expression "$Env:PYTHON -V"
264 264 - echo "$Env:RUNTEST_ARGS"
265 265 - echo "$Env:TMP"
266 266 - echo "$Env:TEMP"
267 267
268 268 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" $PYTHON tests/run-tests.py --color=always $RUNTEST_ARGS'
269 269
270 270 windows:
271 271 <<: *windows_runtests
272 272 when: manual
273 273 tags:
274 274 - windows
275 275 variables:
276 276 RUNTEST_ARGS: "-j 8 --blacklist C:/hgdev/tmp/check-tests.txt"
277 277 PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
278 278
279 279 windows-pyox:
280 280 <<: *windows_runtests
281 281 when: manual # pyoxidizer builds seem broken with --no-use-pep517
282 282 tags:
283 283 - windows
284 284 variables:
285 285 RUNTEST_ARGS: "--blacklist C:/hgdev/tmp/check-tests.txt --pyoxidized"
286 286 PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
287 287
288 288 macos:
289 289 <<: *test_c
290 290 stage: platform-compat
291 291 when: manual # avoid overloading the CI by default
292 292 tags:
293 293 - macos
294
295 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
296 # needed nor working.
297 #
298 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
299 # this is the only one we need to test. However testing that build work on all version is useful and match what we do with Linux.
300 #
301 # The weird directory structure match the one we use for Linux to deal with the
302 # multiple jobs. (all this might be unnecessary)
303 build-c-wheel-macos:
304 when: manual # avoid overloading the CI by default
305 stage: build
306 tags:
307 - macos
308 script:
309 - rm -rf tmp-wheels
310 - CIBW_SKIP="pp*" cibuildwheel --output-dir tmp-wheels/
311 - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
312 mkdir -p wheels/c/$py_version/;
313 mv tmp-wheels/*$py_version*.whl wheels/c/$py_version/;
314 done
315 - rm -rf tmp-wheels
316 artifacts:
317 paths:
318 - wheels
319 expire_in: 1 week
General Comments 0
You need to be logged in to leave comments. Login now