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