Show More
@@ -1,253 +1,254 | |||
|
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 | # TODO: we should use an image based on manylinux instead "all-in-one" image |
|
43 | 43 | # used for all test so far. |
|
44 | 44 | .build-wheel: &wheel |
|
45 | 45 | <<: *all |
|
46 | 46 | stage: build |
|
47 | 47 | variables: |
|
48 | 48 | WHEEL_TYPE: "" |
|
49 | 49 | FLAVOR: "" |
|
50 | 50 | MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" |
|
51 | CI_CLEVER_CLOUD_FLAVOR: "XS" | |
|
51 | 52 | before_script: |
|
52 | 53 | - echo "python used, $PYTHON" |
|
53 | 54 | - $PYTHON --version |
|
54 | 55 | - echo $WHEEL_TYPE |
|
55 | 56 | - test -n "$WHEEL_TYPE" |
|
56 | 57 | - echo $FLAVOR |
|
57 | 58 | - mkdir -p wheels/$WHEEL_TYPE |
|
58 | 59 | script: |
|
59 | 60 | - $PYTHON setup.py bdist_wheel $FLAVOR --dist-dir wheels/$WHEEL_TYPE |
|
60 | 61 | artifacts: |
|
61 | 62 | paths: |
|
62 | 63 | - wheels/$WHEEL_TYPE |
|
63 | 64 | expire_in: 1 week |
|
64 | 65 | |
|
65 | 66 | build-c-wheel: |
|
66 | 67 | <<: *wheel |
|
67 | 68 | variables: |
|
68 | 69 | WHEEL_TYPE: "c" |
|
69 | 70 | |
|
70 | 71 | # TODO: We should select the wheel compatible with the python (and plateform) |
|
71 | 72 | # we use. This is necessary to build multiple wheel. |
|
72 | 73 | .runtests_template: &runtests |
|
73 | 74 | <<: *all |
|
74 | 75 | stage: tests |
|
75 | 76 | # The runner made a clone as root. |
|
76 | 77 | # We make a new clone owned by user used to run the step. |
|
77 | 78 | before_script: |
|
78 | 79 | - echo "python used, $PYTHON" |
|
79 | 80 | - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done |
|
80 | 81 | - rm -rf /tmp/mercurial-ci/ # Clean slate if not using containers |
|
81 | 82 | - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no |
|
82 | 83 | - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
|
83 | 84 | - cd /tmp/mercurial-ci/ |
|
84 | 85 | - ls -1 tests/test-check-*.* > /tmp/check-tests.txt |
|
85 | 86 | script: |
|
86 | 87 | - echo "$RUNTEST_ARGS" |
|
87 | 88 | - echo "$WHEEL_TYPE" |
|
88 | 89 | - WHEEL="" |
|
89 | 90 | - if test -n "$WHEEL_TYPE"; then |
|
90 | 91 | WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/*.whl`"; |
|
91 | 92 | test -n "$WHEEL"; |
|
92 | 93 | fi |
|
93 | 94 | - if test -n "$WHEEL"; then |
|
94 | 95 | echo installing from $WHEEL; |
|
95 | 96 | HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --hg-wheel $WHEEL --color=always $RUNTEST_ARGS; |
|
96 | 97 | else |
|
97 | 98 | echo installing from source; |
|
98 | 99 | HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS; |
|
99 | 100 | fi |
|
100 | 101 | |
|
101 | 102 | checks: |
|
102 | 103 | <<: *runtests |
|
103 | 104 | stage: checks |
|
104 | 105 | variables: |
|
105 | 106 | SHOW_VERSION_OF: "$PYTHON black clang-format" |
|
106 | 107 | RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt" |
|
107 | 108 | CI_CLEVER_CLOUD_FLAVOR: S |
|
108 | 109 | |
|
109 | 110 | rust-cargo-test: |
|
110 | 111 | <<: *all |
|
111 | 112 | stage: checks |
|
112 | 113 | script: |
|
113 | 114 | - make rust-tests |
|
114 | 115 | - make cargo-clippy |
|
115 | 116 | variables: |
|
116 | 117 | CI_CLEVER_CLOUD_FLAVOR: S |
|
117 | 118 | |
|
118 | 119 | .test-c: &test_c |
|
119 | 120 | <<: *runtests |
|
120 | 121 | variables: |
|
121 | 122 | RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt" |
|
122 | 123 | TEST_HGTESTS_ALLOW_NETIO: "1" |
|
123 | 124 | |
|
124 | 125 | test-c: |
|
125 | 126 | <<: *test_c |
|
126 | 127 | needs: [build-c-wheel] |
|
127 | 128 | variables: |
|
128 | 129 | WHEEL_TYPE: "c" |
|
129 | 130 | RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt" |
|
130 | 131 | TEST_HGTESTS_ALLOW_NETIO: "1" |
|
131 | 132 | |
|
132 | 133 | test-pure: |
|
133 | 134 | <<: *runtests |
|
134 | 135 | variables: |
|
135 | 136 | RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt" |
|
136 | 137 | |
|
137 | 138 | test-rust: &test_rust |
|
138 | 139 | <<: *runtests |
|
139 | 140 | variables: |
|
140 | 141 | HGWITHRUSTEXT: cpython |
|
141 | 142 | RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt" |
|
142 | 143 | |
|
143 | 144 | test-rhg: |
|
144 | 145 | <<: *runtests |
|
145 | 146 | variables: |
|
146 | 147 | HGWITHRUSTEXT: cpython |
|
147 | 148 | RUNTEST_ARGS: "--rust --rhg --blacklist /tmp/check-tests.txt" |
|
148 | 149 | |
|
149 | 150 | test-chg: |
|
150 | 151 | <<: *runtests |
|
151 | 152 | variables: |
|
152 | 153 | RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg" |
|
153 | 154 | |
|
154 | 155 | # note: we should probably get a full matrix for flavor Γ py-version, but this |
|
155 | 156 | # is a simple start to be able to check if we break the lowest supported |
|
156 | 157 | # version (and 3.12 have been giving us various troubles) |
|
157 | 158 | test-3.8-c: |
|
158 | 159 | <<: *test_c |
|
159 | 160 | stage: py-version-compat |
|
160 | 161 | when: manual # avoid overloading the CI by default |
|
161 | 162 | variables: |
|
162 | 163 | PYTHON: python3.8 |
|
163 | 164 | |
|
164 | 165 | test-3.12-c: |
|
165 | 166 | <<: *test_c |
|
166 | 167 | stage: py-version-compat |
|
167 | 168 | when: manual # avoid overloading the CI by default |
|
168 | 169 | variables: |
|
169 | 170 | PYTHON: python3.12 |
|
170 | 171 | |
|
171 | 172 | test-3.12-rust: |
|
172 | 173 | <<: *test_rust |
|
173 | 174 | stage: py-version-compat |
|
174 | 175 | when: manual # avoid overloading the CI by default |
|
175 | 176 | variables: |
|
176 | 177 | PYTHON: python3.12 |
|
177 | 178 | |
|
178 | 179 | test-3.13-c: |
|
179 | 180 | <<: *test_c |
|
180 | 181 | stage: py-version-compat |
|
181 | 182 | when: manual # avoid overloading the CI by default |
|
182 | 183 | variables: |
|
183 | 184 | PYTHON: python3.13 |
|
184 | 185 | |
|
185 | 186 | test-3.13-rust: |
|
186 | 187 | <<: *test_rust |
|
187 | 188 | stage: py-version-compat |
|
188 | 189 | when: manual # avoid overloading the CI by default |
|
189 | 190 | variables: |
|
190 | 191 | PYTHON: python3.13 |
|
191 | 192 | |
|
192 | 193 | check-pytype: |
|
193 | 194 | <<: *test_rust |
|
194 | 195 | stage: checks |
|
195 | 196 | before_script: |
|
196 | 197 | - 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" |
|
197 | 198 | - echo "PATH, $PATH" |
|
198 | 199 | - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no |
|
199 | 200 | - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
|
200 | 201 | - cd /tmp/mercurial-ci/ |
|
201 | 202 | - make local PYTHON=$PYTHON |
|
202 | 203 | - ./contrib/setup-pytype.sh |
|
203 | 204 | script: |
|
204 | 205 | - echo "Entering script section" |
|
205 | 206 | - sh contrib/check-pytype.sh |
|
206 | 207 | |
|
207 | 208 | # `sh.exe --login` sets a couple of extra environment variables that are defined |
|
208 | 209 | # in the MinGW shell, but switches CWD to /home/$username. The previous value |
|
209 | 210 | # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running |
|
210 | 211 | # run-tests.py- it is needed to make run-tests.py generate a `python3` script |
|
211 | 212 | # that satisfies the various shebang lines and delegates to `py -3`. |
|
212 | 213 | .window_runtests_template: &windows_runtests |
|
213 | 214 | <<: *all |
|
214 | 215 | when: manual # we don't have any Windows runners anymore at the moment |
|
215 | 216 | stage: platform-compat |
|
216 | 217 | before_script: |
|
217 | 218 | - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/hgdev/tmp/check-tests.txt' |
|
218 | 219 | # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 |
|
219 | 220 | |
|
220 | 221 | script: |
|
221 | 222 | - echo "Entering script section" |
|
222 | 223 | - echo "python used, $Env:PYTHON" |
|
223 | 224 | - Invoke-Expression "$Env:PYTHON -V" |
|
224 | 225 | - echo "$Env:RUNTEST_ARGS" |
|
225 | 226 | - echo "$Env:TMP" |
|
226 | 227 | - echo "$Env:TEMP" |
|
227 | 228 | |
|
228 | 229 | - 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' |
|
229 | 230 | |
|
230 | 231 | windows: |
|
231 | 232 | <<: *windows_runtests |
|
232 | 233 | when: manual |
|
233 | 234 | tags: |
|
234 | 235 | - windows |
|
235 | 236 | variables: |
|
236 | 237 | RUNTEST_ARGS: "-j 8 --blacklist C:/hgdev/tmp/check-tests.txt" |
|
237 | 238 | PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe |
|
238 | 239 | |
|
239 | 240 | windows-pyox: |
|
240 | 241 | <<: *windows_runtests |
|
241 | 242 | when: manual # pyoxidizer builds seem broken with --no-use-pep517 |
|
242 | 243 | tags: |
|
243 | 244 | - windows |
|
244 | 245 | variables: |
|
245 | 246 | RUNTEST_ARGS: "--blacklist C:/hgdev/tmp/check-tests.txt --pyoxidized" |
|
246 | 247 | PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe |
|
247 | 248 | |
|
248 | 249 | macos: |
|
249 | 250 | <<: *test_c |
|
250 | 251 | stage: platform-compat |
|
251 | 252 | when: manual # avoid overloading the CI by default |
|
252 | 253 | tags: |
|
253 | 254 | - macos |
General Comments 0
You need to be logged in to leave comments.
Login now