heptapod-ci.yml
734 lines
| 20.2 KiB
| text/x-yaml
|
YamlLexer
/ contrib / heptapod-ci.yml
Raphaël Gomès
|
r51630 | # Don't run pipelines on branch "merge", since we're fast-forward only. | ||
# Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes | ||||
# `branch/stable`), but the hash hasn't changed. There is no reason to | ||||
# re-run the CI in our case, since we haven't built up any specific automation. | ||||
# Right now it's just wasted CI and developer time. | ||||
Raphaël Gomès
|
r51632 | # One can still run the pipeline manually via the web interface, | ||
Raphaël Gomès
|
r51630 | # like in the case of releases, to make *extra* sure that the actual branch | ||
# has succeeded. | ||||
workflow: | ||||
rules: | ||||
r53357 | - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE !~ "/web|schedule/" | |||
Raphaël Gomès
|
r51630 | when: never | ||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" | ||||
Raphaël Gomès
|
r51634 | when: never | ||
- if: $CI_PIPELINE_SOURCE == "push" | ||||
Raphaël Gomès
|
r51633 | when: always | ||
Raphaël Gomès
|
r51630 | - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS | ||
when: never | ||||
- if: $CI_COMMIT_BRANCH | ||||
Raphaël Gomès
|
r51633 | when: always | ||
Raphaël Gomès
|
r51630 | |||
r46573 | stages: | |||
r53151 | - nightly-trigger | |||
r53043 | - build | |||
- checks | ||||
r46573 | - tests | |||
r53043 | - platform-compat | |||
- py-version-compat | ||||
r53135 | - upload | |||
r53043 | ||||
r46573 | ||||
r47041 | image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG | |||
r44752 | ||||
r44754 | variables: | |||
r53149 | # to debug use: | |||
# | ||||
# RE_BRANCH: '/^topic/.+/.+$/' | ||||
# RE_TOPIC: '/^xxx/' | ||||
# | ||||
# Instead of the two following lines: | ||||
RE_BRANCH: '/^branch/.+$/' | ||||
RE_TOPIC: '/^topic/.+/.+$/' | ||||
r44754 | PYTHON: python | |||
Raphaël Gomès
|
r52606 | HG_CI_IMAGE_TAG: "v2.1" | ||
r53104 | # a directory dedicated to creating files and temporary clone | |||
# with shell runner, its content is not cleaned from one call to the next, | ||||
# so plan for it. | ||||
r53105 | TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.." | |||
r53124 | # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither | |||
# needed nor working. | ||||
CIBW_SKIP: "pp*" | ||||
r44754 | ||||
r53101 | .all: | |||
# help changing all job at once when debugging | ||||
r50076 | when: on_success | |||
r53101 | # make sure jobs from later steps does not wait for anything implicit before | |||
# starting. | ||||
r53043 | needs: [] | |||
r48633 | ||||
r53150 | # dummy job that serve dependencies purpose | |||
.dummy: | ||||
# smallest I know of | ||||
image: busybox | ||||
variables: | ||||
GIT_STRATEGY: none | ||||
CI_CLEVER_CLOUD_FLAVOR: "XS" | ||||
script: | ||||
- echo 'nothing to see here' | ||||
r53142 | # a dummy job that only serve to trigger others | |||
# | ||||
# This is useful for two reasons: | ||||
# - the UX around parallel jobs is awful so manually starting them is unpractical | ||||
# - manual starting job cannot make the pipeline "fails" and block a merge, | ||||
# while "on_success" job depending on manual trigger works fine in that regard. | ||||
.trigger: | ||||
r53150 | extends: | |||
- .all | ||||
- .dummy | ||||
r53142 | when: manual | |||
r53151 | ||||
trigger-nightly-build: | ||||
extends: .trigger | ||||
stage: nightly-trigger | ||||
rules: | ||||
r53358 | - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH && $CI_PIPELINE_SOURCE == "schedule" | |||
when: always | ||||
r53151 | - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | |||
when: manual | ||||
allow_failure: true | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: never | ||||
r53101 | .build-wheel: | |||
extends: .all | ||||
r53093 | image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0" | |||
r53090 | stage: build | |||
variables: | ||||
WHEEL_TYPE: "" | ||||
FLAVOR: "" | ||||
r53091 | MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" | |||
r53092 | CI_CLEVER_CLOUD_FLAVOR: "XS" | |||
r53134 | script: | |||
- PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'` | ||||
r53090 | - echo $WHEEL_TYPE | |||
- test -n "$WHEEL_TYPE" | ||||
- echo $FLAVOR | ||||
r53134 | - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID | |||
r53136 | - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID | |||
r53090 | artifacts: | |||
paths: | ||||
r53134 | - wheels/ | |||
r53090 | expire_in: 1 week | |||
r53044 | ||||
r53151 | ||||
r53168 | # build linux wheel for amd64 | |||
r53044 | build-c-wheel: | |||
r53101 | extends: .build-wheel | |||
r53090 | variables: | |||
WHEEL_TYPE: "c" | ||||
r53094 | parallel: | |||
matrix: | ||||
- BUILD_PY_ID: | ||||
- cp38-cp38 | ||||
- cp39-cp39 | ||||
- cp310-cp310 | ||||
- cp311-cp311 | ||||
- cp312-cp312 | ||||
- cp313-cp313 | ||||
r53044 | ||||
r53158 | trigger-wheel-musl: | |||
extends: .trigger | ||||
stage: build | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
build-c-wheel-musl: | ||||
extends: build-c-wheel | ||||
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0" | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-musl" | ||||
r53160 | trigger-wheel-i686: | |||
extends: .trigger | ||||
stage: build | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
build-c-wheel-i686: | ||||
extends: build-c-wheel | ||||
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0" | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-i686" | ||||
trigger-wheel-i686-musl: | ||||
extends: .trigger | ||||
stage: build | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
build-c-wheel-i686-musl: | ||||
extends: build-c-wheel | ||||
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0" | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-i686-musl" | ||||
r53168 | trigger-wheel-arm64: | |||
extends: .trigger | ||||
stage: build | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
build-c-wheel-arm64: | ||||
extends: build-c-wheel | ||||
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-c:v3.0" | ||||
tags: | ||||
- arm64 | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-arm64" | ||||
trigger-wheel-arm64-musl: | ||||
extends: .trigger | ||||
stage: build | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
build-c-wheel-arm64-musl: | ||||
extends: build-c-wheel | ||||
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-musl-c:v3.0" | ||||
tags: | ||||
- arm64 | ||||
rules: | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-arm64-musl" | ||||
r53101 | .runtests: | |||
extends: .all | ||||
r46573 | stage: tests | |||
r53102 | variables: | |||
SHOW_VERSION_OF: "$PYTHON" | ||||
TEST_HGTESTS_ALLOW_NETIO: "0" | ||||
r53103 | FILTER: "" | |||
FLAVOR: "" | ||||
RUNTEST_ARGS: "" | ||||
Dan Villiom Podlaski Christiansen
|
r46861 | # The runner made a clone as root. | ||
# We make a new clone owned by user used to run the step. | ||||
before_script: | ||||
Raphaël Gomès
|
r52605 | - echo "python used, $PYTHON" | ||
r52895 | - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done | |||
r53104 | - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers | |||
- hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no | ||||
- hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | ||||
- cd "${TMP_WORK_DIR}"/mercurial-ci/ | ||||
- ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt | ||||
r44752 | script: | |||
r53103 | - echo "$TEST_HGTESTS_ALLOW_NETIO" | |||
r44756 | - echo "$RUNTEST_ARGS" | |||
r53103 | - echo "$FILTER" | |||
- echo "$FLAVOR" | ||||
r53044 | - echo "$WHEEL_TYPE" | |||
r53106 | - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID` | |||
- PORT_ARG="--port $PORT_START" | ||||
- echo $PORT_ARG | ||||
r53134 | - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` | |||
- echo $PLATFORM | ||||
r53103 | - WHEEL_ARG="" | |||
r53109 | - SHARDING_ARGS="" | |||
r53044 | - if test -n "$WHEEL_TYPE"; then | |||
r53096 | PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`; | |||
echo "$PY_TAG"; | ||||
test -n "PY_TAG"; | ||||
r53134 | WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$PLATFORM/$WHEEL_TYPE/$PY_TAG/*.whl`"; | |||
r53044 | test -n "$WHEEL"; | |||
r53103 | echo installing from $WHEEL; | |||
WHEEL_ARG="--hg-wheel $WHEEL"; | ||||
echo disabling flavor as this is currently incompatible with '"--hg-wheel"'; | ||||
FLAVOR=""; | ||||
r53044 | else | |||
echo installing from source; | ||||
r53103 | fi; | |||
r53109 | - if [ -n "$CI_NODE_INDEX" ]; then | |||
echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]"; | ||||
SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL"; | ||||
echo "sharding... $SHARDING_ARGS"; | ||||
fi | ||||
r53103 | - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" | |||
"$PYTHON" tests/run-tests.py | ||||
--color=always | ||||
r53355 | --tail-report | |||
r53106 | $PORT_ARG | |||
r53103 | $WHEEL_ARG | |||
$FLAVOR | ||||
r53109 | $SHARDING_ARGS | |||
r53103 | $FILTER | |||
$RUNTEST_ARGS; | ||||
r44754 | ||||
Raphaël Gomès
|
r49804 | checks: | ||
r53101 | extends: .runtests | |||
r53043 | stage: checks | |||
r44754 | variables: | |||
r52895 | SHOW_VERSION_OF: "$PYTHON black clang-format" | |||
r53103 | RUNTEST_ARGS: "--time" | |||
r53104 | FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt" | |||
Raphaël Gomès
|
r50840 | CI_CLEVER_CLOUD_FLAVOR: S | ||
r44755 | ||||
Raphaël Gomès
|
r49804 | rust-cargo-test: | ||
r53101 | extends: .all | |||
r53043 | stage: checks | |||
r44755 | script: | |||
- make rust-tests | ||||
Raphaël Gomès
|
r50837 | - make cargo-clippy | ||
r44755 | variables: | |||
Raphaël Gomès
|
r50840 | CI_CLEVER_CLOUD_FLAVOR: S | ||
r44755 | ||||
r53103 | .runtests-no-check: | |||
extends: .runtests | ||||
variables: | ||||
r53104 | FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt" | |||
r53103 | TEST_HGTESTS_ALLOW_NETIO: "1" | |||
r53101 | .test-c: | |||
r53103 | extends: .runtests-no-check | |||
r44756 | variables: | |||
r53103 | FLAVOR: "--no-rust" | |||
r44757 | ||||
r53044 | test-c: | |||
r53101 | extends: .test-c | |||
r53094 | needs: | |||
- job: build-c-wheel | ||||
parallel: | ||||
matrix: | ||||
- BUILD_PY_ID: "cp311-cp311" | ||||
r53044 | variables: | |||
WHEEL_TYPE: "c" | ||||
Raphaël Gomès
|
r49804 | test-pure: | ||
r53103 | extends: .runtests-no-check | |||
r44757 | variables: | |||
r53103 | FLAVOR: "--pure" | |||
r44758 | ||||
r53101 | test-rust: | |||
r53103 | extends: .runtests-no-check | |||
r44758 | variables: | |||
r53103 | HGWITHRUSTEXT: "cpython" | |||
FLAVOR: "--rust" | ||||
r45462 | ||||
Raphaël Gomès
|
r49804 | test-rhg: | ||
r53103 | extends: .runtests-no-check | |||
Simon Sapin
|
r47489 | variables: | ||
r53103 | HGWITHRUSTEXT: "cpython" | |||
FLAVOR: "--rust --rhg" | ||||
Simon Sapin
|
r47489 | |||
Raphaël Gomès
|
r49804 | test-chg: | ||
r53103 | extends: .runtests-no-check | |||
Pulkit Goyal
|
r46762 | variables: | ||
r53103 | FLAVOR: "--chg" | |||
Matt Harbison
|
r47951 | |||
r53142 | ||||
trigger-pycompat: | ||||
extends: .trigger | ||||
stage: py-version-compat | ||||
r53151 | rules: | |||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: on_success | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
r53142 | ||||
.test-c-pycompat: | ||||
extends: .test-c | ||||
stage: py-version-compat | ||||
variables: | ||||
WHEEL_TYPE: "c" | ||||
r52739 | # note: we should probably get a full matrix for flavor × py-version, but this | |||
# is a simple start to be able to check if we break the lowest supported | ||||
# version (and 3.12 have been giving us various troubles) | ||||
test-3.8-c: | ||||
r53142 | extends: .test-c-pycompat | |||
r52739 | variables: | |||
PYTHON: python3.8 | ||||
r53094 | needs: | |||
r53151 | - job: trigger-pycompat | |||
r53094 | - job: build-c-wheel | |||
parallel: | ||||
matrix: | ||||
- BUILD_PY_ID: "cp38-cp38" | ||||
r52739 | ||||
test-3.12-c: | ||||
r53142 | extends: .test-c-pycompat | |||
r52739 | variables: | |||
PYTHON: python3.12 | ||||
r53094 | needs: | |||
r53151 | - job: trigger-pycompat | |||
r53094 | - job: build-c-wheel | |||
parallel: | ||||
matrix: | ||||
- BUILD_PY_ID: "cp312-cp312" | ||||
r52739 | ||||
r52740 | test-3.12-rust: | |||
r53101 | extends: test-rust | |||
r53043 | stage: py-version-compat | |||
r53142 | needs: | |||
- trigger-pycompat | ||||
r52740 | variables: | |||
PYTHON: python3.12 | ||||
r52887 | test-3.13-c: | |||
r53142 | extends: .test-c-pycompat | |||
r52887 | variables: | |||
PYTHON: python3.13 | ||||
r53094 | needs: | |||
r53151 | - job: trigger-pycompat | |||
r53094 | - job: build-c-wheel | |||
parallel: | ||||
matrix: | ||||
- BUILD_PY_ID: "cp313-cp313" | ||||
r52887 | ||||
test-3.13-rust: | ||||
r53101 | extends: test-rust | |||
r53043 | stage: py-version-compat | |||
r53142 | needs: | |||
- trigger-pycompat | ||||
r52887 | variables: | |||
PYTHON: python3.13 | ||||
Raphaël Gomès
|
r49804 | check-pytype: | ||
r53101 | extends: test-rust | |||
r53043 | stage: checks | |||
Matt Harbison
|
r47951 | before_script: | ||
Raphaël Gomès
|
r52606 | - 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" | ||
- echo "PATH, $PATH" | ||||
r53104 | - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no | |||
- hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | ||||
- cd "${TMP_WORK_DIR}"/mercurial-ci/ | ||||
Matt Harbison
|
r47951 | - make local PYTHON=$PYTHON | ||
Matt Harbison
|
r50548 | - ./contrib/setup-pytype.sh | ||
Raphaël Gomès
|
r50397 | script: | ||
- echo "Entering script section" | ||||
Matt Harbison
|
r53296 | - bash contrib/check-pytype.sh | ||
Raphaël Gomès
|
r48370 | |||
# `sh.exe --login` sets a couple of extra environment variables that are defined | ||||
# in the MinGW shell, but switches CWD to /home/$username. The previous value | ||||
# is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running | ||||
# run-tests.py- it is needed to make run-tests.py generate a `python3` script | ||||
# that satisfies the various shebang lines and delegates to `py -3`. | ||||
r53119 | ||||
.windows: | ||||
r53101 | extends: .all | |||
Raphaël Gomès
|
r49354 | when: manual # we don't have any Windows runners anymore at the moment | ||
r53119 | tags: | |||
- windows | ||||
Raphaël Gomès
|
r48370 | before_script: | ||
r53104 | - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt' | |||
Raphaël Gomès
|
r48370 | # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 | ||
r53119 | variables: | |||
PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe | ||||
Raphaël Gomès
|
r48370 | |||
r53126 | # a dummy job that only serve to trigger the wider windows build | |||
trigger-wheel-windows: | ||||
r53142 | extends: .trigger | |||
r53126 | stage: build | |||
r53151 | rules: | |||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
when: never | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual | ||||
allow_failure: true | ||||
r53126 | ||||
build-c-wheel-windows: | ||||
extends: .windows | ||||
stage: build | ||||
# wait for someone to click on "trigger-wheel-windows" | ||||
when: on_success | ||||
needs: | ||||
r53151 | rules: | |||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
needs: | ||||
- "trigger-wheel-windows" | ||||
r53130 | variables: | |||
MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" | ||||
r53126 | script: | |||
- echo "Entering script section" | ||||
- echo "python used, $Env:PYTHON" | ||||
- Invoke-Expression "$Env:PYTHON -V" | ||||
- echo "$Env:RUNTEST_ARGS" | ||||
- echo "$Env:TMP" | ||||
- echo "$Env:TEMP" | ||||
- "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32" | ||||
artifacts: | ||||
paths: | ||||
- wheels | ||||
expire_in: 1 week | ||||
parallel: | ||||
matrix: | ||||
# "cp39" is first as it unlock the tests | ||||
- CIBW_BUILD: | ||||
- "cp39-*" | ||||
- "cp38-*" | ||||
- "cp310-*" | ||||
- "cp311-*" | ||||
- "cp312-*" | ||||
- "cp313-*" | ||||
r53127 | CIBW_ARCHS: | |||
- "AMD64" | ||||
- "x86" | ||||
r53141 | - CIBW_BUILD: | |||
- "cp311-*" | ||||
- "cp312-*" | ||||
- "cp313-*" | ||||
CIBW_ARCHS: | ||||
- "ARM64" | ||||
r53126 | ||||
r53119 | .windows-runtests: | |||
extends: .windows | ||||
stage: platform-compat | ||||
r53129 | # the UX for manual parallel jobs is quite awful, and the job que depends | |||
# upon are manual anyway, so we can make this start automatically once the | ||||
# associated wheel is ready. | ||||
when: on_success | ||||
parallel: 20 | ||||
Raphaël Gomès
|
r48370 | script: | ||
- echo "Entering script section" | ||||
- echo "python used, $Env:PYTHON" | ||||
- Invoke-Expression "$Env:PYTHON -V" | ||||
r53120 | - echo "$Env:HGTESTS_ALLOW_NETIO" | |||
r53128 | - echo "$Env:WHEEL_ARG" | |||
r53120 | - echo "$Env:FLAVOR" | |||
- echo "$Env:FILTER" | ||||
Raphaël Gomès
|
r48370 | - echo "$Env:RUNTEST_ARGS" | ||
Raphaël Gomès
|
r48606 | - echo "$Env:TMP" | ||
- echo "$Env:TEMP" | ||||
r53121 | # This test is hanging the worker and not that important, so lets skip | |||
# it for now | ||||
- C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt' | ||||
Raphaël Gomès
|
r48370 | |||
r53120 | - 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 | ||||
r53355 | --tail-report | |||
r53128 | $WHEEL_ARG | |||
r53120 | $FLAVOR | |||
r53122 | --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID` | |||
r53129 | --shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL | |||
r53120 | $FILTER | |||
$RUNTEST_ARGS; | ||||
' | ||||
variables: | ||||
r53128 | WHEEL_ARG: "" | |||
r53120 | RUNTEST_ARGS: "" | |||
FLAVOR: "" | ||||
r53121 | FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt" | |||
Raphaël Gomès
|
r48370 | |||
Raphaël Gomès
|
r49804 | windows: | ||
r53101 | extends: .windows-runtests | |||
Raphaël Gomès
|
r48370 | variables: | ||
r53143 | RUNTEST_ARGS: "" | |||
r53128 | WHEEL_ARG: "--hg-wheel wheels/win32/mercurial-*-cp39-cp39-win_amd64.whl" | |||
needs: | ||||
- job: build-c-wheel-windows | ||||
parallel: | ||||
matrix: | ||||
- CIBW_BUILD: "cp39-*" | ||||
CIBW_ARCHS: "AMD64" | ||||
Matt Harbison
|
r48635 | |||
Raphaël Gomès
|
r49804 | windows-pyox: | ||
r53101 | extends: .windows-runtests | |||
Matt Harbison
|
r53049 | when: manual # pyoxidizer builds seem broken with --no-use-pep517 | ||
Matt Harbison
|
r48635 | variables: | ||
r53120 | FLAVOR: "--pyoxidized" | |||
Matt Harbison
|
r52907 | |||
macos: | ||||
r53101 | extends: .test-c | |||
r53043 | stage: platform-compat | |||
r53109 | # run the test in multiple shard to help spread the load between concurrent | |||
# MR as the macos runner is a shell runner there is not startup overhead | ||||
# for tests. | ||||
parallel: 10 | ||||
Matt Harbison
|
r52907 | tags: | ||
- macos | ||||
r53100 | variables: | |||
WHEEL_TYPE: "c" | ||||
needs: | ||||
- build-c-wheel-macos | ||||
r53099 | ||||
r53124 | # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as | |||
# 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. | ||||
r53099 | # | |||
r53124 | # CIBW_SKIP is set globally at the start of the file. See comment there. | |||
r53099 | # | |||
# The weird directory structure match the one we use for Linux to deal with the | ||||
# multiple jobs. (all this might be unnecessary) | ||||
build-c-wheel-macos: | ||||
r53151 | rules: | |||
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH | ||||
needs: | ||||
- trigger-nightly-build | ||||
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC | ||||
when: manual # avoid overloading the CI by default | ||||
allow_failure: true | ||||
r53099 | stage: build | |||
tags: | ||||
- macos | ||||
r53112 | variables: | |||
MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1" | ||||
r53099 | script: | |||
r53134 | - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` | |||
r53099 | - rm -rf tmp-wheels | |||
r53124 | - cibuildwheel --output-dir tmp-wheels/ | |||
r53099 | - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do | |||
r53134 | mkdir -p wheels/$PLATFORM/c/$py_version/; | |||
mv tmp-wheels/*$py_version*.whl wheels/$PLATFORM/c/$py_version/; | ||||
r53099 | done | |||
- rm -rf tmp-wheels | ||||
artifacts: | ||||
paths: | ||||
- wheels | ||||
expire_in: 1 week | ||||
r53135 | ||||
r53150 | ||||
.nightly_build_step: | ||||
r53135 | extends: .all | |||
stage: upload | ||||
rules: | ||||
r53149 | - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH' | |||
r53135 | # note that at the time of writing this, this job depends on multiple | |||
# manual one. So it will not run by default, but will automatically run | ||||
# if the manual jobs are triggered. | ||||
# | ||||
# Also beware that "on_success" will ignore failure of manual test we | ||||
# directly depends on. This currently relevant for the "test-3.x-c" | ||||
# tests. | ||||
when: on_success | ||||
r53149 | - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC' | |||
r53135 | when: never | |||
r53150 | ||||
# a dummy job that gather greatly parallel object into one. | ||||
# | ||||
# It exists because gitlab-ci has a "50 jobs" limit on "needs" entries. | ||||
# (yes, this is sad) | ||||
# | ||||
.sink: | ||||
extends: | ||||
r53151 | - .nightly_build_step | |||
r53150 | - .dummy | |||
r53151 | test-result-linux: | |||
r53150 | extends: .sink | |||
needs: | ||||
- test-c | ||||
- test-3.8-c | ||||
- test-3.12-c | ||||
- test-3.13-c | ||||
r53151 | test-result-macos: | |||
r53150 | extends: .sink | |||
needs: | ||||
- macos | ||||
r53151 | test-result-windows: | |||
r53150 | extends: .sink | |||
needs: | ||||
- windows | ||||
r53169 | wheel-result-linux: | |||
extends: .sink | ||||
needs: | ||||
- build-c-wheel | ||||
- build-c-wheel-musl | ||||
- build-c-wheel-i686 | ||||
- build-c-wheel-i686-musl | ||||
- build-c-wheel-arm64 | ||||
- build-c-wheel-arm64-musl | ||||
artifacts: | ||||
paths: | ||||
- wheels | ||||
expire_in: 1 week | ||||
wheel-result-windows: | ||||
extends: .sink | ||||
needs: | ||||
- build-c-wheel-windows | ||||
artifacts: | ||||
paths: | ||||
- wheels | ||||
expire_in: 1 week | ||||
r53150 | # Upload nightly build wheel on the heptapod registry on test success | |||
# | ||||
# At the time this task is added, since the mac wheels are built on shell | ||||
# runner, those nightly are not be considered fully secured. | ||||
# | ||||
# In addition, since any job can upload package, pretty much anyone with CI | ||||
# access can upload anything pretending to be any version. To fix it we would | ||||
# have to prevent the CI token to upload to the registry and have dedicated | ||||
# credential accessible only from protected branches. | ||||
upload-wheel-nightly: | ||||
extends: .nightly_build_step | ||||
image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0" | ||||
# because we don't want to upload only half of a wheel | ||||
interruptible: false | ||||
r53135 | needs: | |||
r53169 | - wheel-result-linux | |||
- wheel-result-windows | ||||
r53168 | - build-c-wheel-macos | |||
r53151 | - test-result-linux | |||
- test-result-macos | ||||
- test-result-windows | ||||
r53135 | # It would be nice to be able to restrict that a bit to protected branch only | |||
variables: | ||||
TWINE_USERNAME: gitlab-ci-token | ||||
TWINE_PASSWORD: $CI_JOB_TOKEN | ||||
script: | ||||
- twine | ||||
upload | ||||
--verbose | ||||
--repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi | ||||
wheels/*/*/*/*.whl | ||||
wheels/*/*.whl | ||||