Mercurial > hg
comparison contrib/heptapod-ci.yml @ 52152:de4b9ea2fa34 default tip
branching: merge stable into default
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 29 Oct 2024 09:38:48 +0100 |
parents | 0de1895c2218 |
children |
comparison
equal
deleted
inserted
replaced
52146:d57593030416 | 52152:de4b9ea2fa34 |
---|---|
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 - build | |
24 - checks | |
23 - tests | 25 - tests |
26 - platform-compat | |
27 - py-version-compat | |
28 | |
24 | 29 |
25 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG | 30 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG |
26 | 31 |
27 variables: | 32 variables: |
28 PYTHON: python | 33 PYTHON: python |
30 TEST_HGTESTS_ALLOW_NETIO: "0" | 35 TEST_HGTESTS_ALLOW_NETIO: "0" |
31 SHOW_VERSION_OF: "$PYTHON" | 36 SHOW_VERSION_OF: "$PYTHON" |
32 | 37 |
33 .all_template: &all | 38 .all_template: &all |
34 when: on_success | 39 when: on_success |
35 | 40 needs: [] |
41 | |
42 # TODO: we should use an image based on manylinux instead "all-in-one" image | |
43 # used for all test so far. | |
44 .build-wheel: &wheel | |
45 <<: *all | |
46 stage: build | |
47 variables: | |
48 WHEEL_TYPE: "" | |
49 FLAVOR: "" | |
50 before_script: | |
51 - echo "python used, $PYTHON" | |
52 - $PYTHON --version | |
53 - echo $WHEEL_TYPE | |
54 - test -n "$WHEEL_TYPE" | |
55 - echo $FLAVOR | |
56 - mkdir -p wheels/$WHEEL_TYPE | |
57 script: | |
58 - $PYTHON setup.py bdist_wheel $FLAVOR --dist-dir wheels/$WHEEL_TYPE | |
59 artifacts: | |
60 paths: | |
61 - wheels/$WHEEL_TYPE | |
62 expire_in: 1 week | |
63 | |
64 build-c-wheel: | |
65 <<: *wheel | |
66 variables: | |
67 WHEEL_TYPE: "c" | |
68 | |
69 # TODO: We should select the wheel compatible with the python (and plateform) | |
70 # we use. This is necessary to build multiple wheel. | |
36 .runtests_template: &runtests | 71 .runtests_template: &runtests |
37 <<: *all | 72 <<: *all |
38 stage: tests | 73 stage: tests |
39 # The runner made a clone as root. | 74 # The runner made a clone as root. |
40 # We make a new clone owned by user used to run the step. | 75 # We make a new clone owned by user used to run the step. |
46 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | 81 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
47 - cd /tmp/mercurial-ci/ | 82 - cd /tmp/mercurial-ci/ |
48 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt | 83 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt |
49 script: | 84 script: |
50 - echo "$RUNTEST_ARGS" | 85 - echo "$RUNTEST_ARGS" |
51 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS | 86 - echo "$WHEEL_TYPE" |
87 - WHEEL="" | |
88 - if test -n "$WHEEL_TYPE"; then | |
89 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/*.whl`"; | |
90 test -n "$WHEEL"; | |
91 fi | |
92 - if test -n "$WHEEL"; then | |
93 echo installing from $WHEEL; | |
94 HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --hg-wheel $WHEEL --color=always $RUNTEST_ARGS; | |
95 else | |
96 echo installing from source; | |
97 HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS; | |
98 fi | |
52 | 99 |
53 checks: | 100 checks: |
54 <<: *runtests | 101 <<: *runtests |
102 stage: checks | |
55 variables: | 103 variables: |
56 SHOW_VERSION_OF: "$PYTHON black clang-format" | 104 SHOW_VERSION_OF: "$PYTHON black clang-format" |
57 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt" | 105 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt" |
58 CI_CLEVER_CLOUD_FLAVOR: S | 106 CI_CLEVER_CLOUD_FLAVOR: S |
59 | 107 |
60 rust-cargo-test: | 108 rust-cargo-test: |
61 <<: *all | 109 <<: *all |
62 stage: tests | 110 stage: checks |
63 script: | 111 script: |
64 - make rust-tests | 112 - make rust-tests |
65 - make cargo-clippy | 113 - make cargo-clippy |
66 variables: | 114 variables: |
67 CI_CLEVER_CLOUD_FLAVOR: S | 115 CI_CLEVER_CLOUD_FLAVOR: S |
68 | 116 |
69 test-c: &test_c | 117 .test-c: &test_c |
70 <<: *runtests | 118 <<: *runtests |
71 variables: | 119 variables: |
72 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt" | 120 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt" |
121 TEST_HGTESTS_ALLOW_NETIO: "1" | |
122 | |
123 test-c: | |
124 <<: *test_c | |
125 needs: [build-c-wheel] | |
126 variables: | |
127 WHEEL_TYPE: "c" | |
128 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt" | |
73 TEST_HGTESTS_ALLOW_NETIO: "1" | 129 TEST_HGTESTS_ALLOW_NETIO: "1" |
74 | 130 |
75 test-pure: | 131 test-pure: |
76 <<: *runtests | 132 <<: *runtests |
77 variables: | 133 variables: |
97 # note: we should probably get a full matrix for flavor × py-version, but this | 153 # note: we should probably get a full matrix for flavor × py-version, but this |
98 # is a simple start to be able to check if we break the lowest supported | 154 # is a simple start to be able to check if we break the lowest supported |
99 # version (and 3.12 have been giving us various troubles) | 155 # version (and 3.12 have been giving us various troubles) |
100 test-3.8-c: | 156 test-3.8-c: |
101 <<: *test_c | 157 <<: *test_c |
158 stage: py-version-compat | |
102 when: manual # avoid overloading the CI by default | 159 when: manual # avoid overloading the CI by default |
103 variables: | 160 variables: |
104 PYTHON: python3.8 | 161 PYTHON: python3.8 |
105 | 162 |
106 test-3.12-c: | 163 test-3.12-c: |
107 <<: *test_c | 164 <<: *test_c |
165 stage: py-version-compat | |
108 when: manual # avoid overloading the CI by default | 166 when: manual # avoid overloading the CI by default |
109 variables: | 167 variables: |
110 PYTHON: python3.12 | 168 PYTHON: python3.12 |
111 | 169 |
112 test-3.12-rust: | 170 test-3.12-rust: |
113 <<: *test_rust | 171 <<: *test_rust |
172 stage: py-version-compat | |
114 when: manual # avoid overloading the CI by default | 173 when: manual # avoid overloading the CI by default |
115 variables: | 174 variables: |
116 PYTHON: python3.12 | 175 PYTHON: python3.12 |
117 | 176 |
118 test-3.13-c: | 177 test-3.13-c: |
119 <<: *test_c | 178 <<: *test_c |
179 stage: py-version-compat | |
120 when: manual # avoid overloading the CI by default | 180 when: manual # avoid overloading the CI by default |
121 variables: | 181 variables: |
122 PYTHON: python3.13 | 182 PYTHON: python3.13 |
123 | 183 |
124 test-3.13-rust: | 184 test-3.13-rust: |
125 <<: *test_rust | 185 <<: *test_rust |
186 stage: py-version-compat | |
126 when: manual # avoid overloading the CI by default | 187 when: manual # avoid overloading the CI by default |
127 variables: | 188 variables: |
128 PYTHON: python3.13 | 189 PYTHON: python3.13 |
129 | 190 |
130 check-pytype: | 191 check-pytype: |
131 extends: .runtests_template | 192 <<: *test_rust |
193 stage: checks | |
132 before_script: | 194 before_script: |
133 - 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" | 195 - 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" |
134 - echo "PATH, $PATH" | 196 - echo "PATH, $PATH" |
135 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no | 197 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no |
136 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | 198 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` |
147 # run-tests.py- it is needed to make run-tests.py generate a `python3` script | 209 # run-tests.py- it is needed to make run-tests.py generate a `python3` script |
148 # that satisfies the various shebang lines and delegates to `py -3`. | 210 # that satisfies the various shebang lines and delegates to `py -3`. |
149 .window_runtests_template: &windows_runtests | 211 .window_runtests_template: &windows_runtests |
150 <<: *all | 212 <<: *all |
151 when: manual # we don't have any Windows runners anymore at the moment | 213 when: manual # we don't have any Windows runners anymore at the moment |
152 stage: tests | 214 stage: platform-compat |
153 before_script: | 215 before_script: |
154 - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/Temp/check-tests.txt' | 216 - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/Temp/check-tests.txt' |
155 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 | 217 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 |
156 | 218 |
157 script: | 219 script: |
181 RUNTEST_ARGS: "--blacklist C:/Temp/check-tests.txt --pyoxidized" | 243 RUNTEST_ARGS: "--blacklist C:/Temp/check-tests.txt --pyoxidized" |
182 PYTHON: py -3 | 244 PYTHON: py -3 |
183 | 245 |
184 macos: | 246 macos: |
185 <<: *test_c | 247 <<: *test_c |
248 stage: platform-compat | |
186 when: manual # avoid overloading the CI by default | 249 when: manual # avoid overloading the CI by default |
187 tags: | 250 tags: |
188 - macos | 251 - macos |