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