-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
137 lines (123 loc) · 2.57 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
variables:
WORK_PATH: /home/esp/esp-open-rtos/examples/project
FIRMWARE_BIN_DIR: firmware
WIFI_VARS_PATH: include/private_ssid_config.h
GIT_SUBMODULE_STRATEGY: recursive
stages:
- lint
- build
- test
- api-docs
- docs
# template jobs
.code-style:
stage: lint
image: marcotti/esp-open-rtos
before_script:
- cd $WORK_PATH
- cp -r $CI_PROJECT_DIR/$DEVICE_ESP_DIR/* .
- envsubst < $WIFI_VARS_PATH | sponge $WIFI_VARS_PATH
script:
- make lint
tags:
- local
- amd64
.build-device:
stage: build
image: marcotti/esp-open-rtos
before_script:
- cd $WORK_PATH
- cp -r $CI_PROJECT_DIR/$DEVICE_ESP_DIR/* .
- envsubst < $WIFI_VARS_PATH | sponge $WIFI_VARS_PATH
script:
- make
- mkdir $CI_PROJECT_DIR/$DEVICE_ESP_DIR/firmware
- cp $FIRMWARE_BIN_DIR/* $CI_PROJECT_DIR/$DEVICE_ESP_DIR/$FIRMWARE_BIN_DIR/image.bin
tags:
- local
- amd64
artifacts:
paths:
- $CI_PROJECT_DIR/$DEVICE_ESP_DIR/$FIRMWARE_BIN_DIR/image.bin
expire_in: 1 week
.test-device:
image: marcotti/esptool-minimal:latest
variables:
ESP_PORT: /dev/ttyUSB0
BAUD_RATE: 115200
FW_POSITION: 0x2000
stage: test
before_script:
- esptool.py --port $ESP_PORT --baud $BAUD_RATE write_flash $FW_POSITION $DEVICE_ESP_DIR/$FIRMWARE_BIN_DIR/*.bin
- pip install websockets
script:
- python3 -m unittest discover -v -s $DEVICE/tests
tags:
- rpi
.aero:
variables:
DEVICE: aeropendulum
DEVICE_ESP_DIR: aeropendulum/esp
.experimental:
variables:
DEVICE: experimental
DEVICE_ESP_DIR: experimental/esp
# device specific jobs
style-aero:
extends:
- .aero
- .code-style
needs: []
style-experimental:
extends:
- .experimental
- .code-style
needs: []
build-aero:
extends:
- .aero
- .build-device
needs: []
build-experimental:
extends:
- .experimental
- .build-device
needs: []
test-experimental:
extends:
- .experimental
- .test-device
needs: ["build-experimental"]
test-aero:
extends:
- .aero
- .test-device
needs: ["build-aero"]
# generic jobs
openapi:
stage: api-docs
image: node:latest
script:
- npm install -g redoc-cli
- mkdir -p public/
- redoc-cli bundle -o public/openapi.html docs/api.yaml
artifacts:
paths:
- public
only:
- master
pages:
stage: docs
image: nxpleuvenjenkins/doxygen
script:
- doxygen .gci/Doxyfile
- mv $CI_PROJECT_DIR/public/html/* $CI_PROJECT_DIR/public
tags:
- local
- amd64
artifacts:
paths:
- $CI_PROJECT_DIR/public/*
expire_in: 1 week
only:
- master