-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (61 loc) · 1.42 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
stages:
- test
- build
- release
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH || $CI_COMMIT_TAG
variables:
PDM_CACHE_DIR: ${CI_PROJECT_DIR}/.pdm-cache
image: python:3.11
before_script:
- python -m pip install pdm
test:linux:
stage: test
script:
- pdm sync --clean
- pdm run pytest --cov=hg_setup tests
test:real-life:
stage: test
script:
- python -m pip install uv
- uv tool install mercurial --with hg-git --with hg-evolve
- uv tool install .
- export PATH=/root/.local/bin:$PATH
- hg-setup init --auto
- cd $HOME
- hg clone https://github.com/fluiddyn/hg-setup.git
- cd hg-setup
build:package:
stage: build
script:
- pdm config cache_dir ${PDM_CACHE_DIR}
- pdm build || pdm lock --group :all --refresh
needs: []
artifacts:
when: always
paths:
- pdm.lock
- dist
expire_in: 24 hrs
cache:
when: always
key: pdmcache-$CI_COMMIT_BRANCH
paths:
- ${PDM_CACHE_DIR}
# manually set PDM_PUBLISH_PASSWORD in web interface to your pypi API token
release:package:
stage: release
rules:
- if: '$CI_MERGE_REQUEST_ID'
when: never
- if: '$CI_COMMIT_TAG'
when: on_success
variables:
PDM_PUBLISH_USERNAME: __token__
script:
- pdm publish --no-build
needs: [ "build:package" ]