-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
161 lines (139 loc) · 2.8 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
stages:
- setup
- analyze
- unit-test
- regression-test
- build
- publish
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
.poetry-job:
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POETRY_VIRTUALENVS_IN_PROJECT: "true"
before_script:
- pip install poetry
- poetry install -vv
cache:
paths:
- .cache/pip/
- .venv/
.setup-job:
extends: .poetry-job
stage: setup
script:
- poetry env info
.analyze-job:
extends: .poetry-job
stage: analyze
image: python:3.9
cache:
key: cache-cp39
.unittest-job:
extends: .poetry-job
stage: unit-test
script:
- poetry run python -m unittest discover -v -s "tests" -p "test_*.py"
.regressiontest-job:
extends: .poetry-job
stage: regression-test
script:
- poetry run python3 examples/nonlinear.py
- poetry run python3 examples/f16.py
rules:
- if: "$CI_OPEN_MERGE_REQUESTS"
.build-job:
extends: .poetry-job
stage: build
image: python:3.9
before_script:
- pip install poetry
cache:
key: cache-cp39
.publish-job:
stage: publish
image: python:3.9
before_script:
- pip install poetry
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v*/'
cache:
key: cache-cp39
virtualenv-cp39:
extends: .setup-job
image: python:3.9
cache:
key: cache-cp39
flake8:
extends: .analyze-job
script:
- poetry run flake8 -j 1 --statistics src stubs examples tests
black:
extends: .analyze-job
script:
- poetry run black --check src tests stubs examples
mypy:
extends: .analyze-job
script:
- poetry run mypy --pretty
isort:
extends: .analyze-job
script:
- poetry run isort --check src stubs tests examples
unittest-cp38:
extends: .unittest-job
image: python:3.8
cache:
key: cache-cp38
unittest-cp39:
extends: .unittest-job
image: python:3.9
cache:
key: cache-cp39
unittest-cp310:
extends: .unittest-job
image: python:3.10
cache:
key: cache-cp310
regressiontest-cp38:
extends: .regressiontest-job
image: python:3.8
cache:
key: cache-cp38
regressiontest-cp39:
extends: .regressiontest-job
image: python:3.9
regressiontest-cp310:
extends: .regressiontest-job
image: python:3.9
cache: {}
wheel:
extends: .build-job
script:
- poetry build
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v*/'
when: never
- when: on_success
pypi:
extends: .publish-job
script:
- poetry build
- poetry publish
artifacts:
paths:
- dist/*.whl
- dist/*.tar.gz
pages:
extends: .publish-job
script:
- poetry install
- poetry run sphinx-build -b html docs public
artifacts:
paths:
- public