... |
... |
@@ -2,23 +2,27 @@ |
2
|
2
|
image: python:3.5-stretch
|
3
|
3
|
|
4
|
4
|
variables:
|
5
|
|
- BGD: bgd --verbose
|
|
5
|
+ BGD: env/bin/bgd --verbose
|
6
|
6
|
|
7
|
7
|
stages:
|
8
|
8
|
- test
|
9
|
9
|
- post
|
10
|
10
|
|
11
|
11
|
before_script:
|
12
|
|
- - pip3 install setuptools
|
13
|
|
- - export PATH=~/.local/bin:${PATH}
|
14
|
|
- - pip3 install --user -e .
|
|
12
|
+ - python3 -m venv env
|
|
13
|
+ - env/bin/python -m pip install --upgrade setuptools pip
|
|
14
|
+ - env/bin/python -m pip install --editable .
|
15
|
15
|
|
|
16
|
+
|
|
17
|
+#
|
|
18
|
+# Test stage:
|
16
|
19
|
.tests-template: &linux-tests
|
17
|
20
|
stage: test
|
18
|
21
|
variables:
|
19
|
22
|
PYTEST_ADDOPTS: "--color=yes"
|
20
|
23
|
script:
|
21
|
|
- - python3 setup.py test
|
|
24
|
+ - env/bin/python -m pip install --editable ".[tests]"
|
|
25
|
+ - env/bin/python setup.py test
|
22
|
26
|
- mkdir -p coverage/
|
23
|
27
|
- cp .coverage.* coverage/coverage."${CI_JOB_NAME}"
|
24
|
28
|
artifacts:
|
... |
... |
@@ -37,32 +41,44 @@ tests-debian-stretch: |
37
|
41
|
<<: *linux-tests
|
38
|
42
|
|
39
|
43
|
run-dummy-job-debian:
|
40
|
|
- image: buildstream/buildstream-debian
|
41
|
44
|
<<: *dummy-job
|
42
|
45
|
|
|
46
|
+build-docs:
|
|
47
|
+ stage: test
|
|
48
|
+ script:
|
|
49
|
+ - env/bin/python -m pip install --editable ".[docs]"
|
|
50
|
+ - env/bin/python setup.py build_sphinx
|
|
51
|
+ - cp -rf build/sphinx/html public
|
|
52
|
+ artifacts:
|
|
53
|
+ paths:
|
|
54
|
+ - public/
|
|
55
|
+
|
43
|
56
|
|
|
57
|
+#
|
|
58
|
+# Post stage:
|
44
|
59
|
coverage:
|
45
|
60
|
stage: post
|
46
|
61
|
coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
|
47
|
62
|
script:
|
48
|
|
- - pip3 install coverage==4.4.0
|
|
63
|
+ - env/bin/python -m pip install coverage==4.4.0
|
49
|
64
|
- mkdir report
|
50
|
65
|
- cd report
|
51
|
66
|
- cp ../coverage/coverage.* .
|
52
|
67
|
- ls coverage.*
|
53
|
|
- - coverage combine --rcfile=../.coveragerc -a coverage.*
|
54
|
|
- - coverage report --rcfile=../.coveragerc -m
|
|
68
|
+ - env/bin/coverage combine --rcfile=../.coveragerc -a coverage.*
|
|
69
|
+ - env/bin/coverage report --rcfile=../.coveragerc -m
|
55
|
70
|
dependencies:
|
56
|
71
|
- tests-debian-stretch
|
57
|
72
|
|
58
|
|
-# Deploy, only for merges which land on master branch.
|
|
73
|
+
|
59
|
74
|
#
|
|
75
|
+# Deploy stage (master only):
|
60
|
76
|
pages:
|
61
|
77
|
stage: post
|
62
|
78
|
dependencies:
|
63
|
|
- - tests-debian-stretch
|
|
79
|
+ - build-docs
|
64
|
80
|
script:
|
65
|
|
- - mv coverage/ public/
|
|
81
|
+ - find public/
|
66
|
82
|
artifacts:
|
67
|
83
|
paths:
|
68
|
84
|
- public/
|