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