-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
180 lines (158 loc) · 4.5 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
before_script:
- python --version
- python ci/secrets.py
- pip install -r requirements.txt
stages:
- analysis
- test
- release
####################################################################################################
### Analysis Stage
####################################################################################################
pylint_3_9_16:
stage: analysis
image: "python:3.9.16-alpine3.17"
script:
- pylint scheduler
allow_failure: true
mypy_3_9_16:
stage: analysis
image: "python:3.9.16-alpine3.17"
script:
- mypy scheduler
allow_failure: true
pydocstyle_3_9_16:
stage: analysis
image: "python:3.9.16-alpine3.17"
script:
- pydocstyle scheduler
allow_failure: true
bandit_3_9_16:
stage: analysis
image: "python:3.9.16-alpine3.17"
script:
- bandit -r scheduler
allow_failure: false
####################################################################################################
### Test Stage
####################################################################################################
doc_3_9_16:
stage: test
image: "python:3.9.16-alpine3.17"
script:
- sphinx-build -b html doc/ doc/_build/html
artifacts:
paths:
- doc/_build/html/
pytest_3_9_16:
stage: test
image: "python:3.9.16-alpine3.17"
script:
- pytest --cov=scheduler/ tests/
pydoctest_3_9_16:
stage: test
image: "python:3.9.16-alpine3.17"
script:
- pytest --doctest-modules doc/pages/*/*.rst
pytest_3_10_9:
stage: test
image: "python:3.10.9-alpine3.17"
script:
- pytest --cov=scheduler/ tests/
pydoctest_3_10_9:
stage: test
image: "python:3.10.9-alpine3.17"
script:
- pytest --doctest-modules doc/pages/*/*.rst
pytest_3_11_1:
stage: test
image: "python:3.11.1-alpine3.17"
script:
- pytest --cov=scheduler/ tests/
pydoctest_3_11_1:
stage: test
image: "python:3.11.1-alpine3.17"
script:
- pytest --doctest-modules doc/pages/*/*.rst
pytest_3_12_1:
stage: test
image: "python:3.12.1-alpine3.19"
script:
- pytest --cov=scheduler/ tests/
pydoctest_3_12_1:
stage: test
image: "python:3.12.1-alpine3.19"
script:
- pytest --doctest-modules doc/pages/*/*.rst
pytest_3_13_1:
stage: test
image: "python:3.13.1-alpine3.21"
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
script:
- pytest --cov=scheduler/ tests/
- python -m coverage html
artifacts:
paths:
- htmlcov/
pydoctest_3_13_1:
stage: test
image: "python:3.13.1-alpine3.21"
script:
- pytest --doctest-modules doc/pages/*/*.rst
####################################################################################################
### Release Stage
####################################################################################################
push_doc:
image: archlinux:base-20230108.0.116909
stage: release
before_script: []
script:
- tar -C ./doc/_build/html -cpz . -f ./doc_build.tar.gz
- >
curl -X 'POST'
'https://digon.io/hyd/api/v1/version/upload'
-H 'accept: application/json'
-H "Authorization: Bearer ${HYD_TOKEN}"
-H 'Content-Type: multipart/form-data'
-F 'file=@doc_build.tar.gz;type=application/gzip'
-F "project_id=${HYD_PROJECT_ID}"
-F "version=${CI_COMMIT_SHORT_SHA}"
- >
curl -X 'PATCH'
"https://digon.io/hyd/api/v1/tag/move?project_id=${HYD_PROJECT_ID}&tag=${CI_COMMIT_BRANCH}&version=${CI_COMMIT_SHORT_SHA}"
-H 'accept: application/json'
-H "Authorization: Bearer ${HYD_TOKEN}"
only:
- master
- development
push_cov:
image: archlinux:base-20230108.0.116909
stage: release
before_script: []
script:
- tar -C ./htmlcov -cpz . -f ./cov_report.tar.gz
- >
curl -X 'POST'
'https://digon.io/hyd/api/v1/version/upload'
-H 'accept: application/json'
-H "Authorization: Bearer ${HYD_TOKEN}"
-H 'Content-Type: multipart/form-data'
-F 'file=@cov_report.tar.gz;type=application/gzip'
-F "project_id=${HYD_PROJECT_ID}"
-F "version=${CI_COMMIT_SHORT_SHA}_coverage_report"
- >
curl -X 'PATCH'
"https://digon.io/hyd/api/v1/tag/move?project_id=${HYD_PROJECT_ID}&tag=${CI_COMMIT_BRANCH}_coverage_report&version=${CI_COMMIT_SHORT_SHA}_coverage_report"
-H 'accept: application/json'
-H "Authorization: Bearer ${HYD_TOKEN}"
only:
- development
pypi:
image: python:3.10.9-bullseye
stage: release
script:
- pip install twine build
- python -m build
- twine upload dist/*
rules:
- if: '$CI_COMMIT_TAG =~ /^\d+.\d+.\d+/'