contrib/heptapod-ci.yml
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sun, 10 Nov 2024 00:46:44 +0100
branchstable
changeset 52185 4496f059cf5c
parent 52182 fa58f4f97337
child 52191 a76dcb82148e
permissions -rw-r--r--
wheel: enforce that translation being build for macos wheel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50734
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     1
# Don't run pipelines on branch "merge", since we're fast-forward only.
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     2
# Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     3
# `branch/stable`), but the hash hasn't changed. There is no reason to
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     4
# re-run the CI in our case, since we haven't built up any specific automation.
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     5
# Right now it's just wasted CI and developer time.
50736
f5b02cce82ff heptapod-ci: remove push exception for named branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50735
diff changeset
     6
# One can still run the pipeline manually via the web interface,
50734
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     7
# like in the case of releases, to make *extra* sure that the actual branch
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     8
# has succeeded.
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
     9
workflow:
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    10
  rules:
50736
f5b02cce82ff heptapod-ci: remove push exception for named branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50735
diff changeset
    11
    - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
50734
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    12
      when: never
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    13
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
50738
929655c0e613 heptapod-ci: turn off pipelines for merge request events
Raphaël Gomès <rgomes@octobus.net>
parents: 50737
diff changeset
    14
      when: never
929655c0e613 heptapod-ci: turn off pipelines for merge request events
Raphaël Gomès <rgomes@octobus.net>
parents: 50737
diff changeset
    15
    - if: $CI_PIPELINE_SOURCE == "push"
50737
1aba446bf8e6 heptapod-ci: always make the default run condition explicit
Raphaël Gomès <rgomes@octobus.net>
parents: 50736
diff changeset
    16
      when: always
50734
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    17
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    18
      when: never
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    19
    - if: $CI_COMMIT_BRANCH
50737
1aba446bf8e6 heptapod-ci: always make the default run condition explicit
Raphaël Gomès <rgomes@octobus.net>
parents: 50736
diff changeset
    20
      when: always
50734
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50484
diff changeset
    21
45974
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45912
diff changeset
    22
stages:
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    23
  - build
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    24
  - checks
45974
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45912
diff changeset
    25
  - tests
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    26
  - platform-compat
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    27
  - py-version-compat
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    28
45974
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45912
diff changeset
    29
46323
723d241543b0 heptapod-ci: allow testing with docker image other than :latest
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46256
diff changeset
    30
image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
44166
8b1dd3f42396 heptapod-ci: add a basic file to be able to run tests with heptapod
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
44168
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44167
diff changeset
    32
variables:
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44167
diff changeset
    33
    PYTHON: python
51772
74f1bf147a6d heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net>
parents: 51771
diff changeset
    34
    HG_CI_IMAGE_TAG: "v2.1"
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    35
    # a directory dedicated to creating files and temporary clone
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    36
    # with shell runner, its content is not cleaned from one call to the next,
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    37
    # so plan for it.
52178
d6ed4da850ea ci: move the "tempory work dir" to "concurrency-safe" location
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52177
diff changeset
    38
    TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
44168
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44167
diff changeset
    39
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    40
.all:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    41
  # help changing all job at once when debugging
48865
477b5145e1a0 ci: do not trigger phabricator for merge-request
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48858
diff changeset
    42
  when: on_success
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    43
  # make sure jobs from later steps does not wait for anything implicit before
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    44
  # starting.
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
    45
  needs: []
47820
f6879956a386 ci: add a "all" template to easily control "when" test run
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47805
diff changeset
    46
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    47
.build-wheel:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    48
  extends: .all
52166
94ded8440db6 ci: use a pre-setup many-linux image to build wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52165
diff changeset
    49
  image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    50
  stage: build
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    51
  variables:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    52
    WHEEL_TYPE: ""
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    53
    FLAVOR: ""
52164
2c4283c9fa93 setup: add a way to force the setup to translate (or fail)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52163
diff changeset
    54
    MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
52165
d22b6d6e02e1 ci: use smaller VM to build wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52164
diff changeset
    55
    CI_CLEVER_CLOUD_FLAVOR: "XS"
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    56
  before_script:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    57
    - echo $WHEEL_TYPE
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    58
    - test -n "$WHEEL_TYPE"
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    59
    - echo $FLAVOR
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    60
    - mkdir -p wheels/$WHEEL_TYPE/$BUILD_PY_ID
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    61
  script:
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    62
    - /opt/python/$BUILD_PY_ID/bin/python setup.py bdist_wheel --dist-dir tmp-wheelhouse
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    63
    - auditwheel repair tmp-wheelhouse/*.whl -w wheels/$WHEEL_TYPE/$BUILD_PY_ID
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    64
  artifacts:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    65
    paths:
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    66
      - wheels/$WHEEL_TYPE/$BUILD_PY_ID
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    67
    expire_in: 1 week
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
    68
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
    69
build-c-wheel:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    70
  extends: .build-wheel
52163
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    71
  variables:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52151
diff changeset
    72
    WHEEL_TYPE: "c"
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    73
  parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    74
    matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    75
      - BUILD_PY_ID:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    76
          - cp38-cp38
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    77
          - cp39-cp39
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    78
          - cp310-cp310
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    79
          - cp311-cp311
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    80
          - cp312-cp312
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
    81
          - cp313-cp313
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
    82
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    83
.runtests:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
    84
    extends: .all
45974
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45912
diff changeset
    85
    stage: tests
52175
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52174
diff changeset
    86
    variables:
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52174
diff changeset
    87
      SHOW_VERSION_OF: "$PYTHON"
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52174
diff changeset
    88
      TEST_HGTESTS_ALLOW_NETIO: "0"
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
    89
      FILTER: ""
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
    90
      FLAVOR: ""
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
    91
      RUNTEST_ARGS: ""
46244
fb69b51b4daa ci: avoid a global before_script definition
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 46147
diff changeset
    92
    # The runner made a clone as root.
fb69b51b4daa ci: avoid a global before_script definition
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 46147
diff changeset
    93
    # We make a new clone owned by user used to run the step.
fb69b51b4daa ci: avoid a global before_script definition
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 46147
diff changeset
    94
    before_script:
51771
e153995011b7 heptapod-ci: move version prints closer to the start
Raphaël Gomès <rgomes@octobus.net>
parents: 51759
diff changeset
    95
      - echo "python used, $PYTHON"
52032
22a50b7934d2 ci: display tool version more selectively
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52024
diff changeset
    96
      - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    97
      - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/  # Clean slate if not using containers
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    98
      - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
    99
      - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   100
      - cd "${TMP_WORK_DIR}"/mercurial-ci/
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   101
      - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
44166
8b1dd3f42396 heptapod-ci: add a basic file to be able to run tests with heptapod
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   102
    script:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   103
        - echo "$TEST_HGTESTS_ALLOW_NETIO"
44170
8814308e83bb heptapod-ci: run the normal test suite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44169
diff changeset
   104
        - echo "$RUNTEST_ARGS"
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   105
        - echo "$FILTER"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   106
        - echo "$FLAVOR"
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   107
        - echo "$WHEEL_TYPE"
52179
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52178
diff changeset
   108
        - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID`
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52178
diff changeset
   109
        - PORT_ARG="--port $PORT_START"
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52178
diff changeset
   110
        - echo $PORT_ARG
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   111
        - WHEEL_ARG=""
52182
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   112
        - SHARDING_ARGS=""
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   113
        - if test -n "$WHEEL_TYPE"; then
52169
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52167
diff changeset
   114
             PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52167
diff changeset
   115
             echo "$PY_TAG";
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52167
diff changeset
   116
             test -n "PY_TAG";
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52167
diff changeset
   117
             WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$WHEEL_TYPE/$PY_TAG/*.whl`";
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   118
             test -n "$WHEEL";
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   119
             echo installing from $WHEEL;
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   120
             WHEEL_ARG="--hg-wheel $WHEEL";
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   121
             echo disabling flavor as this is currently incompatible with '"--hg-wheel"';
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   122
             FLAVOR="";
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   123
          else
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   124
            echo installing from source;
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   125
          fi;
52182
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   126
        - if [ -n "$CI_NODE_INDEX" ]; then 
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   127
            echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]";
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   128
            SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL";
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   129
            echo "sharding... $SHARDING_ARGS";
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   130
          fi
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   131
        - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   132
          "$PYTHON" tests/run-tests.py
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   133
            --color=always
52179
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52178
diff changeset
   134
            $PORT_ARG
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   135
            $WHEEL_ARG
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   136
            $FLAVOR
52182
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   137
            $SHARDING_ARGS
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   138
            $FILTER
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   139
            $RUNTEST_ARGS;
44168
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44167
diff changeset
   140
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   141
checks:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   142
    extends: .runtests
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   143
    stage: checks
44168
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44167
diff changeset
   144
    variables:
52032
22a50b7934d2 ci: display tool version more selectively
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52024
diff changeset
   145
        SHOW_VERSION_OF: "$PYTHON black clang-format"
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   146
        RUNTEST_ARGS: "--time"
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   147
        FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
49639
d00ac86fbd78 contrib: adjust heptapod CI flavor sizes
Raphaël Gomès <rgomes@octobus.net>
parents: 49512
diff changeset
   148
        CI_CLEVER_CLOUD_FLAVOR: S
44169
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44168
diff changeset
   149
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   150
rust-cargo-test:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   151
    extends: .all
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   152
    stage: checks
44169
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44168
diff changeset
   153
    script:
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44168
diff changeset
   154
        - make rust-tests
50013
86958104b6ca heptapod-ci: add `clippy` to the CI
Raphaël Gomès <rgomes@octobus.net>
parents: 49770
diff changeset
   155
        - make cargo-clippy
44169
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44168
diff changeset
   156
    variables:
49639
d00ac86fbd78 contrib: adjust heptapod CI flavor sizes
Raphaël Gomès <rgomes@octobus.net>
parents: 49512
diff changeset
   157
        CI_CLEVER_CLOUD_FLAVOR: S
44169
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44168
diff changeset
   158
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   159
.runtests-no-check:
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   160
  extends: .runtests
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   161
  variables:
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   162
      FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   163
      TEST_HGTESTS_ALLOW_NETIO: "1"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   164
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   165
.test-c:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   166
    extends: .runtests-no-check
44170
8814308e83bb heptapod-ci: run the normal test suite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44169
diff changeset
   167
    variables:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   168
        FLAVOR: "--no-rust"
44171
6733c565ca46 heptapod-ci: run the --pure test too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44170
diff changeset
   169
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   170
test-c:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   171
    extends: .test-c
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   172
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   173
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   174
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   175
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   176
            - BUILD_PY_ID: "cp311-cp311"
52147
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   177
    variables:
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   178
        WHEEL_TYPE: "c"
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52146
diff changeset
   179
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   180
test-pure:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   181
    extends: .runtests-no-check
44171
6733c565ca46 heptapod-ci: run the --pure test too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44170
diff changeset
   182
    variables:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   183
        FLAVOR: "--pure"
44172
541a509a47a8 heptapod-ci: add a job to test the rust version of Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44171
diff changeset
   184
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   185
test-rust:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   186
    extends: .runtests-no-check
44172
541a509a47a8 heptapod-ci: add a job to test the rust version of Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44171
diff changeset
   187
    variables:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   188
        HGWITHRUSTEXT: "cpython"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   189
        FLAVOR: "--rust"
44977
aa568b6c6a10 heptapod-ci: also run tests for chg on python 2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44586
diff changeset
   190
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   191
test-rhg:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   192
    extends: .runtests-no-check
46768
6b5714479288 ci: Add a job testing with rhg installed as `hg`
Simon Sapin <simon.sapin@octobus.net>
parents: 46715
diff changeset
   193
    variables:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   194
        HGWITHRUSTEXT: "cpython"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   195
        FLAVOR: "--rust --rhg"
46768
6b5714479288 ci: Add a job testing with rhg installed as `hg`
Simon Sapin <simon.sapin@octobus.net>
parents: 46715
diff changeset
   196
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   197
test-chg:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   198
    extends: .runtests-no-check
46147
d109dda4a3e7 contrib: run python3+chg tests too in heptapod CI
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46049
diff changeset
   199
    variables:
52176
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52175
diff changeset
   200
        FLAVOR: "--chg"
47040
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   201
51884
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   202
# note: we should probably get a full matrix for flavor × py-version, but this
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   203
# is a simple start to be able to check if we break the lowest supported
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   204
# version (and 3.12 have been giving us various troubles)
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   205
test-3.8-c:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   206
    extends: .test-c
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   207
    stage: py-version-compat
51884
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   208
    when: manual  # avoid overloading the CI by default
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   209
    variables:
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   210
        PYTHON: python3.8
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   211
        WHEEL_TYPE: "c"
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   212
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   213
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   214
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   215
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   216
            - BUILD_PY_ID: "cp38-cp38"
51884
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   217
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   218
test-3.12-c:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   219
    extends: .test-c
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   220
    stage: py-version-compat
51884
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   221
    when: manual  # avoid overloading the CI by default
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   222
    variables:
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   223
        PYTHON: python3.12
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   224
        WHEEL_TYPE: "c"
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   225
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   226
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   227
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   228
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   229
            - BUILD_PY_ID: "cp312-cp312"
51884
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51876
diff changeset
   230
51885
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51884
diff changeset
   231
test-3.12-rust:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   232
    extends: test-rust
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   233
    stage: py-version-compat
51885
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51884
diff changeset
   234
    when: manual  # avoid overloading the CI by default
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51884
diff changeset
   235
    variables:
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51884
diff changeset
   236
        PYTHON: python3.12
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51884
diff changeset
   237
52024
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   238
test-3.13-c:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   239
    extends: .test-c
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   240
    stage: py-version-compat
52024
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   241
    when: manual  # avoid overloading the CI by default
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   242
    variables:
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   243
        PYTHON: python3.13
52167
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   244
        WHEEL_TYPE: "c"
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   245
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   246
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   247
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   248
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52166
diff changeset
   249
            - BUILD_PY_ID: "cp313-cp313"
52024
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   250
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   251
test-3.13-rust:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   252
    extends: test-rust
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   253
    stage: py-version-compat
52024
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   254
    when: manual  # avoid overloading the CI by default
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   255
    variables:
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   256
        PYTHON: python3.13
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51993
diff changeset
   257
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   258
check-pytype:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   259
    extends: test-rust
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   260
    stage: checks
47040
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   261
    before_script:
51772
74f1bf147a6d heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net>
parents: 51771
diff changeset
   262
      - 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"
74f1bf147a6d heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net>
parents: 51771
diff changeset
   263
      - echo "PATH, $PATH"
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   264
      - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   265
      - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   266
      - cd "${TMP_WORK_DIR}"/mercurial-ci/
47040
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   267
      - make local PYTHON=$PYTHON
49769
556efeea6dbf ci: run the script to add vendored type stubs to typeshed
Matt Harbison <matt_harbison@yahoo.com>
parents: 49512
diff changeset
   268
      - ./contrib/setup-pytype.sh
49422
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49287
diff changeset
   269
    script:
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49287
diff changeset
   270
      - echo "Entering script section"
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49287
diff changeset
   271
      - sh contrib/check-pytype.sh
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   272
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   273
# `sh.exe --login` sets a couple of extra environment variables that are defined
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   274
# in the MinGW shell, but switches CWD to /home/$username.  The previous value
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   275
# is stored in OLDPWD.  Of the added variables, MSYSTEM is crucial to running
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   276
# run-tests.py- it is needed to make run-tests.py generate a `python3` script
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   277
# that satisfies the various shebang lines and delegates to `py -3`.
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   278
.windows-runtests:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   279
    extends: .all
48345
b52cf5063865 heptapod-ci: make Windows jobs manual again
Raphaël Gomès <rgomes@octobus.net>
parents: 48326
diff changeset
   280
    when: manual  # we don't have any Windows runners anymore at the moment
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   281
    stage: platform-compat
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   282
    before_script:
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   283
      - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt'
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   284
      # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   285
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   286
    script:
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   287
        - echo "Entering script section"
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   288
        - echo "python used, $Env:PYTHON"
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   289
        - Invoke-Expression "$Env:PYTHON -V"
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   290
        - echo "$Env:RUNTEST_ARGS"
47801
d5d46dcd356b windows-ci: clean up the Heptapod CI file now that the baseline is solid
Raphaël Gomès <rgomes@octobus.net>
parents: 47791
diff changeset
   291
        - echo "$Env:TMP"
d5d46dcd356b windows-ci: clean up the Heptapod CI file now that the baseline is solid
Raphaël Gomès <rgomes@octobus.net>
parents: 47791
diff changeset
   292
        - echo "$Env:TEMP"
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   293
52151
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52147
diff changeset
   294
        - 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'
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   295
    variables:
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   296
      TMP_WORK_DIR: "C:/hgdev/tmp"
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   297
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   298
windows:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   299
    extends: .windows-runtests
52151
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52147
diff changeset
   300
    when: manual
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   301
    tags:
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   302
      - windows
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47040
diff changeset
   303
    variables:
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   304
        RUNTEST_ARGS: "-j 8 --blacklist ${TMP_WORK_DIR}/check-tests.txt"
52151
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52147
diff changeset
   305
        PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
47822
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47820
diff changeset
   306
49040
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48898
diff changeset
   307
windows-pyox:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   308
    extends: .windows-runtests
52151
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52147
diff changeset
   309
    when: manual  # pyoxidizer builds seem broken with --no-use-pep517
47822
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47820
diff changeset
   310
    tags:
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47820
diff changeset
   311
      - windows
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47820
diff changeset
   312
    variables:
52177
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52176
diff changeset
   313
        RUNTEST_ARGS: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --pyoxidized"
52151
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52147
diff changeset
   314
        PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
52041
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52032
diff changeset
   315
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52032
diff changeset
   316
macos:
52174
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52173
diff changeset
   317
    extends: .test-c
52146
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52145
diff changeset
   318
    stage: platform-compat
52182
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   319
    # run the test in multiple shard to help spread the load between concurrent
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   320
    # MR as the macos runner is a shell runner there is not startup overhead
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   321
    # for tests.
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52180
diff changeset
   322
    parallel: 10
52041
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52032
diff changeset
   323
    tags:
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52032
diff changeset
   324
      - macos
52173
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52172
diff changeset
   325
    variables:
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52172
diff changeset
   326
        WHEEL_TYPE: "c"
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52172
diff changeset
   327
    needs:
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52172
diff changeset
   328
      - build-c-wheel-macos
52172
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   329
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   330
# we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   331
# needed nor working.
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   332
#
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   333
# We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   334
# 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.
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   335
#
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   336
# The weird directory structure match the one we use for Linux to deal with the
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   337
# multiple jobs. (all this might be unnecessary)
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   338
build-c-wheel-macos:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   339
    when: manual  # avoid overloading the CI by default
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   340
    stage: build
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   341
    tags:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   342
      - macos
52185
4496f059cf5c wheel: enforce that translation being build for macos wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52182
diff changeset
   343
    variables:
4496f059cf5c wheel: enforce that translation being build for macos wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52182
diff changeset
   344
      MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
52172
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   345
    script:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   346
      - rm -rf tmp-wheels
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   347
      - CIBW_SKIP="pp*" cibuildwheel --output-dir tmp-wheels/
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   348
      - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   349
          mkdir -p wheels/c/$py_version/;
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   350
          mv tmp-wheels/*$py_version*.whl wheels/c/$py_version/;
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   351
        done
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   352
      - rm -rf tmp-wheels
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   353
    artifacts:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   354
      paths:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   355
        - wheels
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52169
diff changeset
   356
      expire_in: 1 week