-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
110 lines (97 loc) · 2.47 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SPDX-FileCopyrightText: 2024 Helmholtz-Zentrum hereon GmbH
#
# SPDX-License-Identifier: CC0-1.0
image: python:3.9
include: "/ci/.gitlab-ci.build.yml"
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
before_script:
- python -m pip install -U pip
test-package:
stage: test
script:
- pip install twine
- twine check dist/* wheelhouse/*
needs:
- job: build-package-sdist
- job: build-package-linux
- job: build-package-windows
optional: true
- job: build-package-macos
test:
stage: test
variables:
PIPENV_PIPFILE: "ci/matrix/${SCENARIO}/Pipfile"
script:
- pip install pipenv
- pipenv install
- NPROCS=auto make pipenv-test
parallel:
matrix:
- SCENARIO: default
artifacts:
name: pipfile
paths:
- "ci/matrix/${SCENARIO}/*"
expire_in: 30 days
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
needs:
- build-package-sdist
test-docs:
stage: test
script:
- make dev-install
- make -C docs html
- make -C docs linkcheck
artifacts:
paths:
- docs/_build
needs:
- build-package-sdist
deploy-package:
stage: deploy
needs:
- job: build-package-sdist
- job: build-package-linux
- job: build-package-windows
optional: true
- job: build-package-macos
- job: test-package
- job: test-docs
- job: test
only:
# we need at least one existing tag to deploy from branches
- tags
script:
- pip install twine
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* wheelhouse/*
deploy-docs:
stage: deploy
only:
- main
needs:
- test-docs
image: node:21
before_script:
- npm install -g gh-pages@6.1.1
- mkdir .gh-pages-cache
script:
# make sure, the DEPLOY_TOKEN is defined
- >-
[ ${CI_DEPLOY_TOKEN} ] ||
echo "The CI_DEPLOY_TOKEN variable is not set. Please create an access
token with scope 'read_repository' and 'write_repository'" &&
[ ${CI_DEPLOY_TOKEN} ]
- >-
CACHE_DIR=$(realpath .gh-pages-cache)
gh-pages
--dotfiles
--nojekyll
--branch gh-pages
--repo https://ci-user:${CI_DEPLOY_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
--user "${CI_COMMIT_AUTHOR}"
--message "CI Pipeline ${CI_PIPELINE_ID}, commit ${CI_COMMIT_SHORT_SHA}"
--dist docs/_build/html