contrib/heptapod-ci.yml
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 15 Nov 2024 00:29:37 +0100
branchstable
changeset 52256 ff1d4b2df8bd
parent 52250 05953a37c608
child 52257 3f7c7a855af0
permissions -rw-r--r--
ci: abstract the branch matching regexp This is less error prone and make debugging branch-only pipeline simpler.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50737
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
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: 50450
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: 50450
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: 50450
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: 50450
diff changeset
     5
# Right now it's just wasted CI and developer time.
50739
f5b02cce82ff heptapod-ci: remove push exception for named branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50738
diff changeset
     6
# One can still run the pipeline manually via the web interface,
50737
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
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: 50450
diff changeset
     8
# has succeeded.
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
     9
workflow:
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
    10
  rules:
50739
f5b02cce82ff heptapod-ci: remove push exception for named branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50738
diff changeset
    11
    - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
50737
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
    12
      when: never
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
    13
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
50741
929655c0e613 heptapod-ci: turn off pipelines for merge request events
Raphaël Gomès <rgomes@octobus.net>
parents: 50740
diff changeset
    14
      when: never
929655c0e613 heptapod-ci: turn off pipelines for merge request events
Raphaël Gomès <rgomes@octobus.net>
parents: 50740
diff changeset
    15
    - if: $CI_PIPELINE_SOURCE == "push"
50740
1aba446bf8e6 heptapod-ci: always make the default run condition explicit
Raphaël Gomès <rgomes@octobus.net>
parents: 50739
diff changeset
    16
      when: always
50737
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
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: 50450
diff changeset
    18
      when: never
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
    19
    - if: $CI_COMMIT_BRANCH
50740
1aba446bf8e6 heptapod-ci: always make the default run condition explicit
Raphaël Gomès <rgomes@octobus.net>
parents: 50739
diff changeset
    20
      when: always
50737
429880fd984c heptapod-ci: don't run pipelines for topic-less branches
Raphaël Gomès <rgomes@octobus.net>
parents: 50450
diff changeset
    21
45959
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45897
diff changeset
    22
stages:
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    23
  - build
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    24
  - checks
45959
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45897
diff changeset
    25
  - tests
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    26
  - platform-compat
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    27
  - py-version-compat
52242
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
    28
  - upload
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    29
45959
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45897
diff changeset
    30
46323
723d241543b0 heptapod-ci: allow testing with docker image other than :latest
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46256
diff changeset
    31
image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
44249
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
    32
44251
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44250
diff changeset
    33
variables:
52256
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    34
    # to debug use:
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    35
    #
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    36
    #   RE_BRANCH: '/^topic/.+/.+$/'
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    37
    #   RE_TOPIC: '/^xxx/'
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    38
    #
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    39
    # Instead of the two following lines:
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    40
    RE_BRANCH: '/^branch/.+$/'
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
    41
    RE_TOPIC: '/^topic/.+/.+$/'
44251
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44250
diff changeset
    42
    PYTHON: python
51713
74f1bf147a6d heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net>
parents: 51712
diff changeset
    43
    HG_CI_IMAGE_TAG: "v2.1"
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
    44
    # 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: 52210
diff changeset
    45
    # 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: 52210
diff changeset
    46
    # so plan for it.
52212
d6ed4da850ea ci: move the "tempory work dir" to "concurrency-safe" location
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52211
diff changeset
    47
    TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
52231
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
    48
    # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
    49
    # needed nor working.
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
    50
    CIBW_SKIP: "pp*"
44251
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44250
diff changeset
    51
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    52
.all:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    53
  # help changing all job at once when debugging
49181
477b5145e1a0 ci: do not trigger phabricator for merge-request
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49161
diff changeset
    54
  when: on_success
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    55
  # 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: 52207
diff changeset
    56
  # starting.
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
    57
  needs: []
47825
f6879956a386 ci: add a "all" template to easily control "when" test run
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47810
diff changeset
    58
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    59
# a dummy job that only serve to trigger others
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    60
#
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    61
# This is useful for two reasons:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    62
# - the UX around parallel jobs is awful so manually starting them is unpractical
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    63
# - manual starting job cannot make the pipeline "fails" and block a merge,
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    64
#   while "on_success" job depending on manual trigger works fine in that regard.
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    65
.trigger:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    66
  extends: .all
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    67
  # smallest I know of
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    68
  image: busybox
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    69
  when: manual
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    70
  variables:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    71
    GIT_STRATEGY: none
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    72
    CI_CLEVER_CLOUD_FLAVOR: "XS"
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    73
  script:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    74
    - echo 'nothing to see here'
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
    75
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    76
.build-wheel:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    77
  extends: .all
52200
94ded8440db6 ci: use a pre-setup many-linux image to build wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52199
diff changeset
    78
  image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
52197
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    79
  stage: build
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    80
  variables:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    81
    WHEEL_TYPE: ""
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    82
    FLAVOR: ""
52198
2c4283c9fa93 setup: add a way to force the setup to translate (or fail)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52197
diff changeset
    83
    MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
52199
d22b6d6e02e1 ci: use smaller VM to build wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52198
diff changeset
    84
    CI_CLEVER_CLOUD_FLAVOR: "XS"
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
    85
  script:
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
    86
    - PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'`
52197
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    87
    - echo $WHEEL_TYPE
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    88
    - test -n "$WHEEL_TYPE"
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    89
    - echo $FLAVOR
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
    90
    - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
52243
4d825ad10840 wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52242
diff changeset
    91
    - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
52197
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    92
  artifacts:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    93
    paths:
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
    94
      - wheels/
52197
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    95
    expire_in: 1 week
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
    96
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
    97
build-c-wheel:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
    98
  extends: .build-wheel
52197
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
    99
  variables:
c32b17e8f414 ci: pre-adjust some identation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52156
diff changeset
   100
    WHEEL_TYPE: "c"
52201
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   101
  parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   102
    matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   103
      - BUILD_PY_ID:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   104
          - cp38-cp38
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   105
          - cp39-cp39
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   106
          - cp310-cp310
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   107
          - cp311-cp311
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   108
          - cp312-cp312
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   109
          - cp313-cp313
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   110
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   111
.runtests:
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   112
    extends: .all
45959
3a3a510617e5 heptapod-ci: add a explicite "test" phases
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45897
diff changeset
   113
    stage: tests
52209
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52208
diff changeset
   114
    variables:
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52208
diff changeset
   115
      SHOW_VERSION_OF: "$PYTHON"
74a9fbc1b574 ci: move some variables closer to their usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52208
diff changeset
   116
      TEST_HGTESTS_ALLOW_NETIO: "0"
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   117
      FILTER: ""
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   118
      FLAVOR: ""
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   119
      RUNTEST_ARGS: ""
46244
fb69b51b4daa ci: avoid a global before_script definition
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 46146
diff changeset
   120
    # The runner made a clone as root.
fb69b51b4daa ci: avoid a global before_script definition
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 46146
diff changeset
   121
    # 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: 46146
diff changeset
   122
    before_script:
51712
e153995011b7 heptapod-ci: move version prints closer to the start
Raphaël Gomès <rgomes@octobus.net>
parents: 51700
diff changeset
   123
      - echo "python used, $PYTHON"
52002
22a50b7934d2 ci: display tool version more selectively
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51994
diff changeset
   124
      - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   125
      - 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: 52210
diff changeset
   126
      - 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: 52210
diff changeset
   127
      - 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: 52210
diff changeset
   128
      - cd "${TMP_WORK_DIR}"/mercurial-ci/
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   129
      - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
44249
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
   130
    script:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   131
        - echo "$TEST_HGTESTS_ALLOW_NETIO"
44253
8814308e83bb heptapod-ci: run the normal test suite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44252
diff changeset
   132
        - echo "$RUNTEST_ARGS"
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   133
        - echo "$FILTER"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   134
        - echo "$FLAVOR"
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   135
        - echo "$WHEEL_TYPE"
52213
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52212
diff changeset
   136
        - 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: 52212
diff changeset
   137
        - PORT_ARG="--port $PORT_START"
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52212
diff changeset
   138
        - echo $PORT_ARG
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   139
        - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   140
        - echo $PLATFORM
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   141
        - WHEEL_ARG=""
52216
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   142
        - SHARDING_ARGS=""
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   143
        - if test -n "$WHEEL_TYPE"; then
52203
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52201
diff changeset
   144
             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: 52201
diff changeset
   145
             echo "$PY_TAG";
5ea21e0c28aa ci: automatically compute the python tag we use to identify tag
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52201
diff changeset
   146
             test -n "PY_TAG";
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   147
             WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$PLATFORM/$WHEEL_TYPE/$PY_TAG/*.whl`";
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   148
             test -n "$WHEEL";
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   149
             echo installing from $WHEEL;
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   150
             WHEEL_ARG="--hg-wheel $WHEEL";
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   151
             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: 52209
diff changeset
   152
             FLAVOR="";
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   153
          else
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   154
            echo installing from source;
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   155
          fi;
52216
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   156
        - 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: 52214
diff changeset
   157
            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: 52214
diff changeset
   158
            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: 52214
diff changeset
   159
            echo "sharding... $SHARDING_ARGS";
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   160
          fi
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   161
        - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   162
          "$PYTHON" tests/run-tests.py
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   163
            --color=always
52213
63ad6b0c2b6a ci: adjust the starting port range to runner concurrency
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52212
diff changeset
   164
            $PORT_ARG
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   165
            $WHEEL_ARG
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   166
            $FLAVOR
52216
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   167
            $SHARDING_ARGS
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   168
            $FILTER
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   169
            $RUNTEST_ARGS;
44251
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44250
diff changeset
   170
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   171
checks:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   172
    extends: .runtests
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   173
    stage: checks
44251
2aa2408e7515 heptapod-ci: run test with python3 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44250
diff changeset
   174
    variables:
52002
22a50b7934d2 ci: display tool version more selectively
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51994
diff changeset
   175
        SHOW_VERSION_OF: "$PYTHON black clang-format"
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   176
        RUNTEST_ARGS: "--time"
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   177
        FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
49945
d00ac86fbd78 contrib: adjust heptapod CI flavor sizes
Raphaël Gomès <rgomes@octobus.net>
parents: 49506
diff changeset
   178
        CI_CLEVER_CLOUD_FLAVOR: S
44252
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44251
diff changeset
   179
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   180
rust-cargo-test:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   181
    extends: .all
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   182
    stage: checks
44252
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44251
diff changeset
   183
    script:
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44251
diff changeset
   184
        - make rust-tests
49940
86958104b6ca heptapod-ci: add `clippy` to the CI
Raphaël Gomès <rgomes@octobus.net>
parents: 49654
diff changeset
   185
        - make cargo-clippy
44252
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44251
diff changeset
   186
    variables:
49945
d00ac86fbd78 contrib: adjust heptapod CI flavor sizes
Raphaël Gomès <rgomes@octobus.net>
parents: 49506
diff changeset
   187
        CI_CLEVER_CLOUD_FLAVOR: S
44252
5fd43c788943 heptapod-ci: also run the dedicated rust test for the rust code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44251
diff changeset
   188
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   189
.runtests-no-check:
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   190
  extends: .runtests
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   191
  variables:
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   192
      FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   193
      TEST_HGTESTS_ALLOW_NETIO: "1"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   194
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   195
.test-c:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   196
    extends: .runtests-no-check
44253
8814308e83bb heptapod-ci: run the normal test suite
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44252
diff changeset
   197
    variables:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   198
        FLAVOR: "--no-rust"
44254
6733c565ca46 heptapod-ci: run the --pure test too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44253
diff changeset
   199
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   200
test-c:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   201
    extends: .test-c
52201
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   202
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   203
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   204
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   205
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   206
            - BUILD_PY_ID: "cp311-cp311"
52151
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   207
    variables:
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   208
        WHEEL_TYPE: "c"
0de1895c2218 ci: build a wheel and use it to run c tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52150
diff changeset
   209
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   210
test-pure:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   211
    extends: .runtests-no-check
44254
6733c565ca46 heptapod-ci: run the --pure test too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44253
diff changeset
   212
    variables:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   213
        FLAVOR: "--pure"
44255
541a509a47a8 heptapod-ci: add a job to test the rust version of Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44254
diff changeset
   214
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   215
test-rust:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   216
    extends: .runtests-no-check
44255
541a509a47a8 heptapod-ci: add a job to test the rust version of Mercurial
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44254
diff changeset
   217
    variables:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   218
        HGWITHRUSTEXT: "cpython"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   219
        FLAVOR: "--rust"
44936
aa568b6c6a10 heptapod-ci: also run tests for chg on python 2
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44577
diff changeset
   220
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   221
test-rhg:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   222
    extends: .runtests-no-check
46755
6b5714479288 ci: Add a job testing with rhg installed as `hg`
Simon Sapin <simon.sapin@octobus.net>
parents: 46676
diff changeset
   223
    variables:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   224
        HGWITHRUSTEXT: "cpython"
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   225
        FLAVOR: "--rust --rhg"
46755
6b5714479288 ci: Add a job testing with rhg installed as `hg`
Simon Sapin <simon.sapin@octobus.net>
parents: 46676
diff changeset
   226
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   227
test-chg:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   228
    extends: .runtests-no-check
46146
d109dda4a3e7 contrib: run python3+chg tests too in heptapod CI
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46045
diff changeset
   229
    variables:
52210
b3d6afa6ebbf ci: rationalize variable usage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52209
diff changeset
   230
        FLAVOR: "--chg"
47081
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   231
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   232
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   233
trigger-pycompat:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   234
  extends: .trigger
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   235
  stage: py-version-compat
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   236
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   237
.test-c-pycompat:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   238
    extends: .test-c
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   239
    stage: py-version-compat
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   240
    needs:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   241
      - trigger-pycompat
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   242
    variables:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   243
        WHEEL_TYPE: "c"
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   244
51846
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   245
# 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: 51835
diff changeset
   246
# 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: 51835
diff changeset
   247
# 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: 51835
diff changeset
   248
test-3.8-c:
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   249
    extends: .test-c-pycompat
51846
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   250
    variables:
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   251
        PYTHON: python3.8
52201
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   252
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   253
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   254
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   255
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   256
            - BUILD_PY_ID: "cp38-cp38"
51846
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   257
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   258
test-3.12-c:
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   259
    extends: .test-c-pycompat
51846
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   260
    variables:
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   261
        PYTHON: python3.12
52201
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   262
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   263
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   264
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   265
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   266
            - BUILD_PY_ID: "cp312-cp312"
51846
243e805e8a2d ci: add the option to test more Python versions
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51835
diff changeset
   267
51847
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51846
diff changeset
   268
test-3.12-rust:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   269
    extends: test-rust
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   270
    stage: py-version-compat
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   271
    needs:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   272
      - trigger-pycompat
51847
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51846
diff changeset
   273
    variables:
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51846
diff changeset
   274
        PYTHON: python3.12
a3a9251c6081 ci: also offer to test 3.12 with rust
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51846
diff changeset
   275
51994
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   276
test-3.13-c:
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   277
    extends: .test-c-pycompat
51994
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   278
    variables:
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   279
        PYTHON: python3.13
52201
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   280
    needs:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   281
      - job: build-c-wheel
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   282
        parallel:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   283
          matrix:
7dd466f13f9b ci: build (and use) wheel for all supported version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52200
diff changeset
   284
            - BUILD_PY_ID: "cp313-cp313"
51994
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   285
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   286
test-3.13-rust:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   287
    extends: test-rust
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   288
    stage: py-version-compat
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   289
    needs:
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   290
      - trigger-pycompat
51994
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   291
    variables:
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   292
        PYTHON: python3.13
baf9e3a8fd14 ci: also offer tests with Python 3.13
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51963
diff changeset
   293
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   294
check-pytype:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   295
    extends: test-rust
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   296
    stage: checks
47081
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   297
    before_script:
51713
74f1bf147a6d heptapod-ci: use new v2.1 image
Raphaël Gomès <rgomes@octobus.net>
parents: 51712
diff changeset
   298
      - 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: 51712
diff changeset
   299
      - echo "PATH, $PATH"
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   300
      - 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: 52210
diff changeset
   301
      - 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: 52210
diff changeset
   302
      - cd "${TMP_WORK_DIR}"/mercurial-ci/
47081
e917fa36fb58 heptapod-ci: enable pytype checking
Matt Harbison <matt_harbison@yahoo.com>
parents: 46980
diff changeset
   303
      - make local PYTHON=$PYTHON
49653
556efeea6dbf ci: run the script to add vendored type stubs to typeshed
Matt Harbison <matt_harbison@yahoo.com>
parents: 49506
diff changeset
   304
      - ./contrib/setup-pytype.sh
49502
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49279
diff changeset
   305
    script:
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49279
diff changeset
   306
      - echo "Entering script section"
dbdee8ac3e3f heptapod-ci: use shell script in pytype step
Raphaël Gomès <rgomes@octobus.net>
parents: 49279
diff changeset
   307
      - sh contrib/check-pytype.sh
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   308
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   309
# `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: 47081
diff changeset
   310
# 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: 47081
diff changeset
   311
# 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: 47081
diff changeset
   312
# 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: 47081
diff changeset
   313
# that satisfies the various shebang lines and delegates to `py -3`.
52226
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   314
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   315
.windows:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   316
    extends: .all
48522
b52cf5063865 heptapod-ci: make Windows jobs manual again
Raphaël Gomès <rgomes@octobus.net>
parents: 48328
diff changeset
   317
    when: manual  # we don't have any Windows runners anymore at the moment
52226
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   318
    tags:
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   319
      - windows
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   320
    before_script:
52211
4762133a56b3 ci: abstract the of absolute /tmp/ path
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52210
diff changeset
   321
      - 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: 47081
diff changeset
   322
      # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
52226
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   323
    variables:
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   324
        PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   325
52233
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   326
# a dummy job that only serve to trigger the wider windows build
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   327
trigger-wheel-windows:
52249
16e5de783a1b ci: adds a trigger for all pycompat jobs
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52248
diff changeset
   328
  extends: .trigger
52233
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   329
  stage: build
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   330
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   331
build-c-wheel-windows:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   332
    extends: .windows
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   333
    stage: build
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   334
    # wait for someone to click on "trigger-wheel-windows"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   335
    when: on_success
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   336
    needs:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   337
      - "trigger-wheel-windows"
52237
4602e90207f3 wheel: enforce that translation being build for windows wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52236
diff changeset
   338
    variables:
4602e90207f3 wheel: enforce that translation being build for windows wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52236
diff changeset
   339
      MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
52233
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   340
    script:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   341
        - echo "Entering script section"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   342
        - echo "python used, $Env:PYTHON"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   343
        - Invoke-Expression "$Env:PYTHON -V"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   344
        - echo "$Env:RUNTEST_ARGS"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   345
        - echo "$Env:TMP"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   346
        - echo "$Env:TEMP"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   347
        - "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   348
    artifacts:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   349
      paths:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   350
        - wheels
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   351
      expire_in: 1 week
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   352
    parallel:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   353
      matrix:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   354
        # "cp39" is first as it unlock the tests
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   355
        - CIBW_BUILD:
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   356
          - "cp39-*"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   357
          - "cp38-*"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   358
          - "cp310-*"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   359
          - "cp311-*"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   360
          - "cp312-*"
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   361
          - "cp313-*"
52234
6c777d25e8a6 wheel: explicitly list built architecture
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52233
diff changeset
   362
          CIBW_ARCHS:
6c777d25e8a6 wheel: explicitly list built architecture
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52233
diff changeset
   363
          - "AMD64"
6c777d25e8a6 wheel: explicitly list built architecture
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52233
diff changeset
   364
          - "x86"
52248
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   365
        - CIBW_BUILD:
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   366
          - "cp311-*"
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   367
          - "cp312-*"
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   368
          - "cp313-*"
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   369
          CIBW_ARCHS:
084e7ae69ae4 wheel: build windows wheel for ARM64 too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52243
diff changeset
   370
          - "ARM64"
52233
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   371
e25e4647437b wheel: build Windows wheels too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52231
diff changeset
   372
52226
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   373
.windows-runtests:
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   374
    extends: .windows
b25fc1f25edf ci: again common element into a `.windows` template
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52225
diff changeset
   375
    stage: platform-compat
52236
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   376
    # the UX for manual parallel jobs is quite awful, and the job que depends
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   377
    # upon are manual anyway, so we can make this start automatically once the
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   378
    # associated wheel is ready.
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   379
    when: on_success
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   380
    parallel: 20
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   381
    script:
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   382
        - echo "Entering script section"
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   383
        - echo "python used, $Env:PYTHON"
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   384
        - Invoke-Expression "$Env:PYTHON -V"
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   385
        - echo "$Env:HGTESTS_ALLOW_NETIO"
52235
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   386
        - echo "$Env:WHEEL_ARG"
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   387
        - echo "$Env:FLAVOR"
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   388
        - echo "$Env:FILTER"
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   389
        - echo "$Env:RUNTEST_ARGS"
47806
d5d46dcd356b windows-ci: clean up the Heptapod CI file now that the baseline is solid
Raphaël Gomès <rgomes@octobus.net>
parents: 47792
diff changeset
   390
        - 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: 47792
diff changeset
   391
        - echo "$Env:TEMP"
52228
be1f06902861 windows: skip test-clonebundles-autogen.t in the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52227
diff changeset
   392
        # This test is hanging the worker and not that important, so lets skip
be1f06902861 windows: skip test-clonebundles-autogen.t in the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52227
diff changeset
   393
        # it for now
be1f06902861 windows: skip test-clonebundles-autogen.t in the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52227
diff changeset
   394
        - C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt'
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   395
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   396
        - C:/hgdev/MinGW/msys/1.0/bin/sh.exe
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   397
          --login -c 'cd "$OLDPWD"
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   398
            && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   399
               $PYTHON tests/run-tests.py
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   400
               --color=always
52235
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   401
               $WHEEL_ARG
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   402
               $FLAVOR
52229
4bbb4fc9af3b ci: adjust port range on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52228
diff changeset
   403
               --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID`
52236
48f772a5c476 ci: shard the tests on windows too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52235
diff changeset
   404
               --shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   405
               $FILTER
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   406
               $RUNTEST_ARGS;
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   407
          '
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   408
    variables:
52235
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   409
      WHEEL_ARG: ""
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   410
      RUNTEST_ARGS: ""
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   411
      FLAVOR: ""
52228
be1f06902861 windows: skip test-clonebundles-autogen.t in the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52227
diff changeset
   412
      FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt"
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   413
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   414
windows:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   415
    extends: .windows-runtests
47570
bc01b8ad6134 ci-windows: introduce manual windows CI
Raphaël Gomès <rgomes@octobus.net>
parents: 47081
diff changeset
   416
    variables:
52250
05953a37c608 ci: let the Windows runner decide how many job they want to run
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52249
diff changeset
   417
        RUNTEST_ARGS: ""
52235
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   418
        WHEEL_ARG: "--hg-wheel wheels/win32/mercurial-*-cp39-cp39-win_amd64.whl"
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   419
    needs:
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   420
      - job: build-c-wheel-windows
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   421
        parallel:
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   422
          matrix:
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   423
            - CIBW_BUILD: "cp39-*"
8cacf7952f14 wheel: test the built wheel in the windows tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52234
diff changeset
   424
              CIBW_ARCHS: "AMD64"
47827
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47825
diff changeset
   425
48949
469b9ee336a6 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net>
parents: 48799
diff changeset
   426
windows-pyox:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   427
    extends: .windows-runtests
52156
8766d47edfd1 ci: add a runner for Windows 10
Matt Harbison <matt_harbison@yahoo.com>
parents: 52151
diff changeset
   428
    when: manual  # pyoxidizer builds seem broken with --no-use-pep517
47827
9261326dd032 ci: run --pyoxidized tests on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 47825
diff changeset
   429
    variables:
52227
f514c5acfdd6 ci: split the windows runtest invocation into more granular variables
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52226
diff changeset
   430
        FLAVOR: "--pyoxidized"
52014
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52002
diff changeset
   431
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52002
diff changeset
   432
macos:
52208
75bc7557e49f ci: use extends instead of <<: *x
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52207
diff changeset
   433
    extends: .test-c
52150
c99cbb02a82e ci: split the jobs on more stage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52149
diff changeset
   434
    stage: platform-compat
52216
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   435
    # 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: 52214
diff changeset
   436
    # 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: 52214
diff changeset
   437
    # for tests.
fa58f4f97337 ci: shard the test run on mac os X
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52214
diff changeset
   438
    parallel: 10
52014
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52002
diff changeset
   439
    tags:
941141c2c475 ci: add a runner for macos
Matt Harbison <matt_harbison@yahoo.com>
parents: 52002
diff changeset
   440
      - macos
52207
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52206
diff changeset
   441
    variables:
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52206
diff changeset
   442
        WHEEL_TYPE: "c"
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52206
diff changeset
   443
    needs:
50fa42a2a79a ci: use the macos wheel to run tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52206
diff changeset
   444
      - build-c-wheel-macos
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   445
52231
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
   446
# We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
   447
# this is the only one we need to test. However testing that build work on all
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
   448
# version is useful and match what we do with Linux.
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   449
#
52231
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
   450
# CIBW_SKIP is set globally at the start of the file. See comment there.
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   451
#
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   452
# 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: 52203
diff changeset
   453
# 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: 52203
diff changeset
   454
build-c-wheel-macos:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   455
    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: 52203
diff changeset
   456
    stage: build
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   457
    tags:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   458
      - macos
52219
4496f059cf5c wheel: enforce that translation being build for macos wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52216
diff changeset
   459
    variables:
4496f059cf5c wheel: enforce that translation being build for macos wheel
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52216
diff changeset
   460
      MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   461
    script:
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   462
      - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   463
      - rm -rf tmp-wheels
52231
d0e728b0db0e wheel: assign CIBW_SKIP globally
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52229
diff changeset
   464
      - cibuildwheel --output-dir tmp-wheels/
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   465
      - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
52241
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   466
          mkdir -p wheels/$PLATFORM/c/$py_version/;
05addf266f6f wheel: add a platform level to the wheel directories
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52237
diff changeset
   467
          mv tmp-wheels/*$py_version*.whl wheels/$PLATFORM/c/$py_version/;
52206
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   468
        done
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   469
      - rm -rf tmp-wheels
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   470
    artifacts:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   471
      paths:
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   472
        - wheels
97d86d5b16f8 wheel: build mac os wheel through the CI
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52203
diff changeset
   473
      expire_in: 1 week
52242
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   474
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   475
# Upload nightly build wheel on the heptapod registry on test success
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   476
#
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   477
# At the time this task is added, since the mac wheels are built on shell
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   478
# runner, those nightly are not be considered fully secured.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   479
#
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   480
# In addition, since any job can upload package, pretty much anyone with CI
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   481
# access can upload anything pretending to be any version. To fix it we would
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   482
# have to prevent the CI token to upload to the registry and have dedicated
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   483
# credential accessible only from protected branches.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   484
upload-wheel-nightly:
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   485
  extends: .all
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   486
  image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0"
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   487
  stage: upload
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   488
  # because we don't want to upload only half of a wheel
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   489
  interruptible: false
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   490
  rules:
52256
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
   491
    - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH'
52242
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   492
      # note that at the time of writing this, this job depends on multiple
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   493
      # manual one. So it will not run by default, but will automatically run
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   494
      # if the manual jobs are triggered.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   495
      #
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   496
      # Also beware that "on_success" will ignore failure of manual test we
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   497
      # directly depends on. This currently relevant for the "test-3.x-c"
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   498
      # tests.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   499
      when: on_success
52256
ff1d4b2df8bd ci: abstract the branch matching regexp
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52250
diff changeset
   500
    - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC'
52242
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   501
      when: never
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   502
      # if you need to test this, make it
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   503
      # when: manual
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   504
      # allow_failure: true
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   505
  needs:
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   506
    - build-c-wheel
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   507
    - build-c-wheel-macos
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   508
    - build-c-wheel-windows
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   509
    - test-c
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   510
    - macos
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   511
    # if we also requires windows to be happy, reach the "50 needed jobs" limit.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   512
    # So we need some intermediate job to reduce the number.
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   513
    # - windows
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   514
    - test-3.8-c
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   515
    - test-3.12-c
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   516
    - test-3.13-c
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   517
  # It would be nice to be able to restrict that a bit to protected branch only
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   518
  variables:
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   519
    TWINE_USERNAME: gitlab-ci-token
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   520
    TWINE_PASSWORD: $CI_JOB_TOKEN
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   521
  script:
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   522
    - twine
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   523
      upload
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   524
      --verbose
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   525
      --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   526
      wheels/*/*/*/*.whl
b8efa9013d3f wheel: add a job uploading nightly build
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 52241
diff changeset
   527
      wheels/*/*.whl