-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
199 lines (177 loc) · 3.7 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
variables: &global-variables
COVERAGE_RCFILE: .coveragerc
DOCKER_BUILDKIT: 1
GIT_DEPTH: 10
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip"
stages:
- build_image
- build
- test
- test_coverage
- page_build
- page_deploy
- upload
.job_template: &setup
image: &dev_image $CI_REGISTRY_IMAGE/build:latest
before_script:
- g++ --version
- python3 --version
except:
- schedules
.test_template: &py_setup
image: &dev_image $CI_REGISTRY_IMAGE/build:latest
stage: test
before_script:
- g++ --version
- python3 --version
- pip3 install $(echo dist/*.whl)
except:
- schedules
artifacts:
paths:
- .coverage.*
- "*.xml"
reports:
junit:
- "*.xml"
interruptible: true
.docker_build_base: &docker_build
image: docker:latest
stage: build_image
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/build:latest || true
- docker build --pull=true --cache-from $CI_REGISTRY_IMAGE/build:latest -t $CI_REGISTRY_IMAGE/build:latest .
- docker push $CI_REGISTRY_IMAGE/build:latest
docker_build_schedule:
<<: *docker_build
only:
- schedules
docker_build_manual:
<<: *docker_build
when: manual
except:
- schedules
wheel_build:
<<: *setup
stage: build
script:
- python3 setup.py bdist_wheel
artifacts:
paths:
- dist/*.whl
b4tf:
<<: *py_setup
script:
- coverage run -m xmlrunner test/test_b4tf.py
PBP:
<<: *py_setup
script:
- coverage run -m xmlrunner test/test_pbp.py
MCBN:
<<: *py_setup
script:
- coverage run -m xmlrunner test/test_mcbn.py
Issue:
<<: *py_setup
script:
- coverage run -m xmlrunner test/test_issue.py
coverage:
<<: *setup
stage: test_coverage
script:
- mkdir -p public/coverage
- coverage combine
- coverage report
- coverage html -d public/coverage
artifacts:
paths:
- public/coverage
coverage: '/^TOTAL.*\s+(\d+\%)$/'
emacs:
image: iquiw/alpine-emacs
stage: build
script:
- emacs --batch README.org -l site/init.el --eval '(org-hugo-export-wim-to-md :all-subtrees nil t)'
- emacs --batch CHANGELOG.org -l site/init.el --eval '(org-hugo-export-wim-to-md :all-subtrees nil t)'
- cd site
- emacs --batch site.org -l init.el --eval '(org-hugo-export-wim-to-md :all-subtrees nil t)'
artifacts:
paths:
- site/content
except:
- schedules
README_MD:
image: iquiw/alpine-emacs
stage: build
script:
- emacs --batch README.org --eval '(org-md-export-to-markdown)'
artifacts:
paths:
- README.md
except:
- schedules
hugo:
image: registry.gitlab.com/pages/hugo:latest
stage: page_build
variables:
<<: *global-variables
GIT_SUBMODULE_STRATEGY: recursive
script:
- hugo version
- cd site
- hugo -c content -v
artifacts:
paths:
- public
needs:
- emacs
except:
- schedules
sphinx:
image: *dev_image
stage: page_build
script:
- pip install $(echo dist/*.whl)
- sphinx-apidoc -F -e -o sphinx b4tf
- sphinx-build -b html -W --keep-going sphinx public/api
artifacts:
paths:
- sphinx/*.rst
- public
needs:
- wheel_build
except:
- schedules
pages:
image: alpine
stage: page_deploy
environment: production
script:
- echo ""
artifacts:
paths:
- public
only:
- master
except:
- schedules
pypi:
image: *dev_image
stage: upload
script:
- rm -rf dist
- python3 setup.py clean
- python3 setup.py sdist bdist_wheel
- twine upload --verbose dist/b4tf-*
only:
- tags
except:
- branches
- schedules
needs:
- README_MD
- coverage
environment: pypi