forked from superna9999/meta-meson
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
300 lines (271 loc) · 7.42 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
variables:
IMAGE_TAG: "2021-09-28-1"
YOCTO_IMAGE: "amlogic-image-headless-initrd"
MACHINE_NAME: "amlogic-s9xxx"
IMAGE_NAME: "uImage"
IMAGE_TYPE: "uimage"
RAMDISK_COMP: "xz"
stages:
- docker
- initrd
- gen
- run
build:docker:
stage: docker
tags:
- yocto
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
image: docker:stable
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:$IMAGE_TAG && exit 0 || true
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$IMAGE_TAG --tag $CI_REGISTRY_IMAGE:latest scripts/
- docker push $CI_REGISTRY_IMAGE:$IMAGE_TAG
- docker push $CI_REGISTRY_IMAGE:latest
build:initrd:
tags:
- yocto
stage: initrd
image: $CI_REGISTRY_IMAGE:$IMAGE_TAG
before_script:
- mkdir -p results
- rm -rf /tmp/build_env
- git clone http://github.com/openembedded/openembedded-core --branch=langdale --depth=1 /tmp/build_env
- git clone http://github.com/openembedded/bitbake --branch=2.2 --depth=1 /tmp/build_env/bitbake
- git clone $(pwd) /tmp/build_env/$(basename $(pwd))
script:
- bash scripts/prepare.sh /tmp/build_env
- bash scripts/build.sh /tmp/build_env $MACHINE_NAME $YOCTO_IMAGE
- cp -ar /tmp/build_env/build/tmp*/deploy/images/$MACHINE_NAME/* $CI_PROJECT_DIR/results/
artifacts:
when: always
paths:
- results/
.gen:
stage: gen
tags:
- yocto
needs: ["build:initrd"]
dependencies:
- build:initrd
image: $CI_REGISTRY_IMAGE:$IMAGE_TAG
script:
- python3 scripts/generate_lava.py
--template scripts/meta-meson.yml.jinja2
--info "$CI_PIPELINE_URL for $DEVICE_TYPE at $CI_COMMIT_REF_NAME"
--base-artifacts-url $CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/raw/results
--device-type ${DEVICE_TYPE}
--kernel-image-name "`readlink results/${IMAGE_NAME}`"
--kernel-image-type ${IMAGE_TYPE}
--dtb-name "`readlink results/${DTB_NAME}`"
--ramdisk-name "`readlink results/${YOCTO_IMAGE}-${MACHINE_NAME}.cpio.${RAMDISK_COMP}`"
--ramdisk-compression ${RAMDISK_COMP}
--boot-method ${BOOT_METHOD}
--tags "${LAVA_TAGS}"
> results/meta-meson-$DEVICE_TYPE.yml
artifacts:
when: always
paths:
- results/
.run:
stage: run
image: $CI_REGISTRY_IMAGE:$IMAGE_TAG
script:
- lava_job_id=`lavacli jobs submit $CI_PROJECT_DIR/results/meta-meson-$DEVICE_TYPE.yml`
- echo $lava_job_id
- lavacli jobs logs $lava_job_id | grep -a -v "{'case':" | tee results/$DEVICE_TYPE.log
- lavacli jobs show $lava_job_id
- lavacli results $lava_job_id
- status=`lavacli jobs show $lava_job_id | grep -c Finished` || echo Failed
- echo status $status
- '[[ "$status" -gt 0 ]]'
- fails=`lavacli results $lava_job_id | grep -c fail` || echo Success
- echo fails $fails
- '[[ "$fails" -eq 0 ]]'
artifacts:
when: always
paths:
- results/
.gen:libretech-ac:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxl-s805x-libretech-ac"
DTB_NAME: "meson-gxl-s805x-libretech-ac.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:libretech-cc:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxl-s905x-libretech-cc"
DTB_NAME: "meson-gxl-s905x-libretech-cc.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
#gen:hardkernel-odroidc2:
# extends: .gen
# variables:
# DEVICE_TYPE: "meson-gxbb-odroidc2"
# DTB_NAME: "meson-gxbb-odroidc2.dtb"
# BOOT_METHOD: "u-boot"
# LAVA_TAGS: ""
gen:hardkernel-odroid-n2:
extends: .gen
variables:
DEVICE_TYPE: "meson-g12b-odroid-n2"
DTB_NAME: "meson-g12b-odroid-n2.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:khadas-vim:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxl-s905x-khadas-vim"
DTB_NAME: "meson-gxl-s905x-khadas-vim.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:khadas-vim2:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxm-khadas-vim2"
DTB_NAME: "meson-gxm-khadas-vim2.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: "panfrost"
gen:amlogic-p230:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxl-s905d-p230"
DTB_NAME: "meson-gxl-s905d-p230.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
.gen:amlogic-p241:
extends: .gen
variables:
DEVICE_TYPE: "meson-gxl-s805x-p241"
DTB_NAME: "meson-gxl-s805x-p241.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:seirobotics-sei510:
extends: .gen
variables:
DEVICE_TYPE: "meson-g12a-sei510"
DTB_NAME: "meson-g12a-sei510.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:seirobotics-sei610:
extends: .gen
variables:
DEVICE_TYPE: "meson-sm1-sei610"
DTB_NAME: "meson-sm1-sei610.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
gen:amediatech-x96-max:
extends: .gen
variables:
DEVICE_TYPE: "meson-g12a-x96-max"
DTB_NAME: "meson-g12a-x96-max.dtb"
BOOT_METHOD: "u-boot"
LAVA_TAGS: ""
.run:libretech-ac:
extends: .run
needs: ["build:initrd", "gen:libretech-ac"]
dependencies:
- gen:libretech-ac
tags:
- lava-meson-gxl-s805x-libretech-ac
variables:
DEVICE_TYPE: "meson-gxl-s805x-libretech-ac"
allow_failure: true
run:libretech-cc:
extends: .run
needs: ["build:initrd", "gen:libretech-cc"]
dependencies:
- gen:libretech-cc
tags:
- lava-meson-gxl-s905x-libretech-cc
variables:
DEVICE_TYPE: "meson-gxl-s905x-libretech-cc"
allow_failure: true
#run:hardkernel-odroidc2:
# extends: .run
# needs: ["build:initrd", "gen:hardkernel-odroidc2"]
# dependencies:
# - gen:hardkernel-odroidc2
# tags:
# - lava-meson-gxbb-odroidc2
# variables:
# DEVICE_TYPE: "meson-gxbb-odroidc2"
# allow_failure: true
run:hardkernel-odroid-n2:
extends: .run
needs: ["build:initrd", "gen:hardkernel-odroid-n2"]
dependencies:
- gen:hardkernel-odroid-n2
tags:
- lava-meson-g12b-odroid-n2
variables:
DEVICE_TYPE: "meson-g12b-odroid-n2"
allow_failure: true
run:khadas-vim:
extends: .run
needs: ["build:initrd", "gen:khadas-vim"]
dependencies:
- gen:khadas-vim
tags:
- lava-meson-gxl-s905x-khadas-vim
variables:
DEVICE_TYPE: "meson-gxl-s905x-khadas-vim"
allow_failure: true
run:khadas-vim2:
extends: .run
needs: ["build:initrd", "gen:khadas-vim2"]
dependencies:
- gen:khadas-vim2
tags:
- lava-meson-gxm-khadas-vim2
variables:
DEVICE_TYPE: "meson-gxm-khadas-vim2"
allow_failure: true
run:amlogic-p230:
extends: .run
needs: ["build:initrd", "gen:amlogic-p230"]
dependencies:
- gen:amlogic-p230
tags:
- lava-meson-gxl-s905d-p230
variables:
DEVICE_TYPE: "meson-gxl-s905d-p230"
allow_failure: true
.run:amlogic-p241:
extends: .run
needs: ["build:initrd", "gen:amlogic-p241"]
dependencies:
- gen:amlogic-p241
tags:
- lava-meson-gxl-s805x-p241
variables:
DEVICE_TYPE: "meson-gxl-s805x-p241"
allow_failure: true
run:seirobotics-sei610:
extends: .run
needs: ["build:initrd", "gen:seirobotics-sei610"]
dependencies:
- gen:seirobotics-sei610
tags:
- lava-meson-g12a-sei610
variables:
DEVICE_TYPE: "meson-sm1-sei610"
allow_failure: true
run:amediatech-x96-max:
extends: .run
needs: ["build:initrd", "gen:amediatech-x96-max"]
dependencies:
- gen:amediatech-x96-max
tags:
- lava-meson-g12a-x96-max
variables:
DEVICE_TYPE: "meson-g12a-x96-max"
allow_failure: true