heptapod-ci.yml
252 lines
| 7.8 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: | ||||
Raphaël Gomès
|
r51632 | - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web" | ||
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: | |||
r53043 | - build | |||
- checks | ||||
r46573 | - tests | |||
r53043 | - platform-compat | |||
- py-version-compat | ||||
r46573 | ||||
r47041 | image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG | |||
r44752 | ||||
r44754 | variables: | |||
PYTHON: python | ||||
Raphaël Gomès
|
r52606 | HG_CI_IMAGE_TAG: "v2.1" | ||
Joerg Sonnenberger
|
r47434 | TEST_HGTESTS_ALLOW_NETIO: "0" | ||
r52895 | SHOW_VERSION_OF: "$PYTHON" | |||
r44754 | ||||
r48633 | .all_template: &all | |||
r50076 | when: on_success | |||
r53043 | needs: [] | |||
r48633 | ||||
r53044 | # TODO: we should use an image based on manylinux instead "all-in-one" image | |||
# used for all test so far. | ||||
.build-wheel: &wheel | ||||
<<: *all | ||||
stage: build | ||||
variables: | ||||
WHEEL_TYPE: "" | ||||
FLAVOR: "" | ||||
before_script: | ||||
- echo "python used, $PYTHON" | ||||
- $PYTHON --version | ||||
- echo $WHEEL_TYPE | ||||
- test -n "$WHEEL_TYPE" | ||||
- echo $FLAVOR | ||||
- mkdir -p wheels/$WHEEL_TYPE | ||||
script: | ||||
- $PYTHON setup.py bdist_wheel $FLAVOR --dist-dir wheels/$WHEEL_TYPE | ||||
artifacts: | ||||
paths: | ||||
- wheels/$WHEEL_TYPE | ||||
expire_in: 1 week | ||||
build-c-wheel: | ||||
<<: *wheel | ||||
variables: | ||||
WHEEL_TYPE: "c" | ||||
# TODO: We should select the wheel compatible with the python (and plateform) | ||||
# we use. This is necessary to build multiple wheel. | ||||
r44754 | .runtests_template: &runtests | |||
r48633 | <<: *all | |||
r46573 | stage: tests | |||
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 | |||
Matt Harbison
|
r52907 | - rm -rf /tmp/mercurial-ci/ # Clean slate if not using containers | ||
Dan Villiom Podlaski Christiansen
|
r46861 | - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no | ||
- hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | ||||
- cd /tmp/mercurial-ci/ | ||||
- ls -1 tests/test-check-*.* > /tmp/check-tests.txt | ||||
r44752 | script: | |||
r44756 | - echo "$RUNTEST_ARGS" | |||
r53044 | - echo "$WHEEL_TYPE" | |||
- WHEEL="" | ||||
- if test -n "$WHEEL_TYPE"; then | ||||
WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/*.whl`"; | ||||
test -n "$WHEEL"; | ||||
fi | ||||
- if test -n "$WHEEL"; then | ||||
echo installing from $WHEEL; | ||||
HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --hg-wheel $WHEEL --color=always $RUNTEST_ARGS; | ||||
else | ||||
echo installing from source; | ||||
HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS; | ||||
fi | ||||
r44754 | ||||
Raphaël Gomès
|
r49804 | checks: | ||
r44754 | <<: *runtests | |||
r53043 | stage: checks | |||
r44754 | variables: | |||
r52895 | SHOW_VERSION_OF: "$PYTHON black clang-format" | |||
r44756 | RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt" | |||
Raphaël Gomès
|
r50840 | CI_CLEVER_CLOUD_FLAVOR: S | ||
r44755 | ||||
Raphaël Gomès
|
r49804 | rust-cargo-test: | ||
r50083 | <<: *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 | ||||
r53044 | .test-c: &test_c | |||
r44756 | <<: *runtests | |||
variables: | ||||
r44974 | RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt" | |||
Joerg Sonnenberger
|
r47434 | TEST_HGTESTS_ALLOW_NETIO: "1" | ||
r44757 | ||||
r53044 | test-c: | |||
<<: *test_c | ||||
needs: [build-c-wheel] | ||||
variables: | ||||
WHEEL_TYPE: "c" | ||||
RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt" | ||||
TEST_HGTESTS_ALLOW_NETIO: "1" | ||||
Raphaël Gomès
|
r49804 | test-pure: | ||
r44757 | <<: *runtests | |||
variables: | ||||
RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt" | ||||
r44758 | ||||
r52740 | test-rust: &test_rust | |||
r44758 | <<: *runtests | |||
variables: | ||||
HGWITHRUSTEXT: cpython | ||||
r44974 | RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt" | |||
r45462 | ||||
Raphaël Gomès
|
r49804 | test-rhg: | ||
Simon Sapin
|
r47489 | <<: *runtests | ||
variables: | ||||
HGWITHRUSTEXT: cpython | ||||
RUNTEST_ARGS: "--rust --rhg --blacklist /tmp/check-tests.txt" | ||||
Raphaël Gomès
|
r49804 | test-chg: | ||
Pulkit Goyal
|
r46762 | <<: *runtests | ||
variables: | ||||
RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg" | ||||
Matt Harbison
|
r47951 | |||
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: | ||||
<<: *test_c | ||||
r53043 | stage: py-version-compat | |||
r52739 | when: manual # avoid overloading the CI by default | |||
variables: | ||||
PYTHON: python3.8 | ||||
test-3.12-c: | ||||
<<: *test_c | ||||
r53043 | stage: py-version-compat | |||
r52739 | when: manual # avoid overloading the CI by default | |||
variables: | ||||
PYTHON: python3.12 | ||||
r52740 | test-3.12-rust: | |||
<<: *test_rust | ||||
r53043 | stage: py-version-compat | |||
r52740 | when: manual # avoid overloading the CI by default | |||
variables: | ||||
PYTHON: python3.12 | ||||
r52887 | test-3.13-c: | |||
<<: *test_c | ||||
r53043 | stage: py-version-compat | |||
r52887 | when: manual # avoid overloading the CI by default | |||
variables: | ||||
PYTHON: python3.13 | ||||
test-3.13-rust: | ||||
<<: *test_rust | ||||
r53043 | stage: py-version-compat | |||
r52887 | when: manual # avoid overloading the CI by default | |||
variables: | ||||
PYTHON: python3.13 | ||||
Raphaël Gomès
|
r49804 | check-pytype: | ||
r53042 | <<: *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" | ||||
Matt Harbison
|
r47951 | - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no | ||
- hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | ||||
- cd /tmp/mercurial-ci/ | ||||
- make local PYTHON=$PYTHON | ||||
Matt Harbison
|
r50548 | - ./contrib/setup-pytype.sh | ||
Raphaël Gomès
|
r50397 | script: | ||
- echo "Entering script section" | ||||
- sh 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`. | ||||
.window_runtests_template: &windows_runtests | ||||
r48633 | <<: *all | |||
Raphaël Gomès
|
r49354 | when: manual # we don't have any Windows runners anymore at the moment | ||
r53043 | stage: platform-compat | |||
Raphaël Gomès
|
r48370 | before_script: | ||
Matt Harbison
|
r53049 | - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/hgdev/tmp/check-tests.txt' | ||
Raphaël Gomès
|
r48370 | # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 | ||
script: | ||||
- echo "Entering script section" | ||||
- echo "python used, $Env:PYTHON" | ||||
- Invoke-Expression "$Env:PYTHON -V" | ||||
- echo "$Env:RUNTEST_ARGS" | ||||
Raphaël Gomès
|
r48606 | - echo "$Env:TMP" | ||
- echo "$Env:TEMP" | ||||
Raphaël Gomès
|
r48370 | |||
Matt Harbison
|
r53049 | - 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' | ||
Raphaël Gomès
|
r48370 | |||
Raphaël Gomès
|
r49804 | windows: | ||
Raphaël Gomès
|
r48370 | <<: *windows_runtests | ||
Matt Harbison
|
r53049 | when: manual | ||
Raphaël Gomès
|
r48370 | tags: | ||
- windows | ||||
variables: | ||||
Matt Harbison
|
r53049 | RUNTEST_ARGS: "-j 8 --blacklist C:/hgdev/tmp/check-tests.txt" | ||
PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe | ||||
Matt Harbison
|
r48635 | |||
Raphaël Gomès
|
r49804 | windows-pyox: | ||
Matt Harbison
|
r48635 | <<: *windows_runtests | ||
Matt Harbison
|
r53049 | when: manual # pyoxidizer builds seem broken with --no-use-pep517 | ||
Matt Harbison
|
r48635 | tags: | ||
- windows | ||||
variables: | ||||
Matt Harbison
|
r53049 | RUNTEST_ARGS: "--blacklist C:/hgdev/tmp/check-tests.txt --pyoxidized" | ||
PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe | ||||
Matt Harbison
|
r52907 | |||
macos: | ||||
<<: *test_c | ||||
r53043 | stage: platform-compat | |||
Matt Harbison
|
r52908 | when: manual # avoid overloading the CI by default | ||
Matt Harbison
|
r52907 | tags: | ||
- macos | ||||