-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
138 lines (125 loc) · 3.69 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
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:3.10
variables:
HTTP_PROXY: "http://webproxy:8080"
HTTPS_PROXY: "http://webproxy:8080"
http_proxy: "http://webproxy:8080"
https_proxy: "http://webproxy:8080"
.install-reporter-and-upload-to-codecov: &install-reporter-and-upload-to-codecov
- curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
- curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
- gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
- shasum -a 256 -c codecov.SHA256SUM
- chmod +x codecov
- ./codecov --upstream ${HTTPS_PROXY} --token ${CODECOV_TOKEN}
before_script:
- pip install --upgrade pip virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install --upgrade pip poetry
quick-test:
rules:
- if: $CI_COMMIT_TAG == null
script:
- poetry install --with test
- pytest -m "not webtest" --verbose --cov=zema_emc_annotated
--junitxml=junit.xml
- coverage xml
- *install-reporter-and-upload-to-codecov
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- junit.xml
- coverage.xml
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
environment: coverage
online-test:
rules:
- if: $CI_COMMIT_TAG == null
script:
- poetry install --with test
- pytest -m webtest --verbose --cov=zema_emc_annotated
--junitxml=junit.xml
- coverage xml
- *install-reporter-and-upload-to-codecov
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- junit.xml
- coverage.xml
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
environment: coverage
mypy:
rules:
- if: $CI_COMMIT_TAG == null
changes:
- "**/*.py"
script:
- poetry install --with lint,test
- mypy .
pylint:
rules:
- if: $CI_COMMIT_TAG == null
changes:
- "**/*.py"
script:
- poetry install --with lint
- pylint src/zema_emc_annotated
flake8:
rules:
- if: $CI_COMMIT_TAG == null
changes:
- "**/*.py"
script:
- poetry install --only lint
- flake8 .
sphinx:
rules:
- if: $CI_COMMIT_TAG == null
script:
- poetry install --extras docs
- apt update
- apt -y install pandoc
- sphinx-build -W --keep-going docs/ docs/_build
black:
rules:
- if: $CI_COMMIT_TAG == null
changes:
- "**/*.py"
script:
- poetry install --only dev
- black --check .
cffconvert:
script:
- pip install --upgrade cffconvert
- cffconvert --validate
release:
rules:
- if: $CI_COMMIT_TAG == null
stage: deploy
script:
- poetry install --with release
- git config --global user.name "Bjoern Ludwig"
- git config --global user.email "bjoern.ludwig@ptb.de"
- export CI_PROJECT_NAMESPACE=PTB-M4D
- export CI_PROJECT_NAME=zema_emc_annotated
- semantic-release --verbosity=DEBUG publish
environment: production