-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
74 lines (65 loc) · 1.98 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- lint
- test
- build
- publish
before_script:
- pip install wheel
- pip install tox
.base_image: &py3_common
image: registry.nic.cz/turris/foris-ci/python3
flake8:
<<: *py3_common
stage: lint
script:
- tox -q -e lint
unit_tests:
<<: *py3_common
stage: test
script:
- tox -q -e py310 -- --backend openwrt --message-bus mqtt tests/unit/
blackbox_openwrt_unix_socket:
<<: *py3_common
stage: test
script:
# production backend + unix-socket bus
- tox -q -e py310 -- --backend openwrt --message-bus unix-socket tests/blackbox/
blackbox_mock_mqtt:
<<: *py3_common
stage: test
script:
# production bus + mock backend
- tox -q -e py310 -- --backend mock --message-bus mqtt tests/blackbox/
blackbox_openwrt_mqtt:
<<: *py3_common
stage: test
script:
# blackbox production config
- tox -q -e py310 -- --backend openwrt --message-bus mqtt tests/blackbox/
blackbox_openwrt_ubus:
<<: *py3_common
stage: test
script:
# blackbox production config
- tox -q -e py310 -- --backend openwrt --message-bus ubus tests/blackbox/
sample_module:
<<: *py3_common
stage: test
script:
# render cookiecutter template
- pip install cookiecutter
- rm -rf /tmp/cookiecutter/
- cookiecutter --no-input doc/examples -o /tmp/cookiecutter/
# install sample module
- cd /tmp/cookiecutter/sample_example/
# initialize git submodule for shared config files
- git init
- git submodule add https://gitlab.nic.cz/turris/foris-controller/common.git common
- ln -s common/foris-controller-modules/tox.ini tox.ini
# test both backends here
- tox -q -e py310 -- --backend openwrt --backend mock --message-bus mqtt --message-bus ubus
include:
- remote: "https://gitlab.nic.cz/turris/foris-controller/packages/-/raw/master/templates/python/base.yml"
- remote: "https://gitlab.nic.cz/turris/foris-controller/packages/-/raw/master/templates/python/build_and_publish.yml"