ci_template: do not .test in the cerbero repo
[platform/upstream/gstreamer.git] / gitlab / ci_template.yml
1 stages:
2   - 'preparation'
3   # Test just one basic build, if it succeeds proceed to test the rest
4   - 'build'
5   - 'test'
6   # Run multiple builds and tests, multi-distro, multi-arch
7   - 'full builds'
8   - 'full tests'
9
10 variables:
11   GIT_STRATEGY: none
12   DEFAULT_MESON_ARGS: >
13     --werror
14     -Dpython=enabled
15     -Dlibav=enabled
16     -Dugly=enabled
17     -Dbad=enabled
18     -Ddevtools=enabled
19     -Dges=enabled
20     -Drtsp_server=enabled
21     -Dvaapi=enabled
22     -Dsharp=disabled
23
24 manifest:
25   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/build-manifest:f085d34a32cb8cac95cbd420344efeaa647d08d5'
26   stage: 'preparation'
27   script:
28     - cd /gst-ci
29     - gitlab/build_manifest.py --self-update
30     - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
31     - cat ${CI_PROJECT_DIR}/manifest.xml
32   artifacts:
33     expire_in: "2 days"
34     paths:
35       - "manifest.xml"
36
37 gst indent:
38   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/gst-indent:6f7e01e1e30a73efa880acdc8e911f1f20c58dbb'
39   stage: 'preparation'
40   variables:
41     GIT_STRATEGY: 'fetch'
42   script:
43     # man indent. grep RETURN VALUE, grab a beer on my behalf...
44     - indent --version || true
45     - curl -o gst-indent https://gitlab.freedesktop.org/gstreamer/gstreamer/raw/master/tools/gst-indent
46     - chmod +x gst-indent
47     - find . -name '*.c' -exec ./gst-indent {} +
48     - |
49       if git diff --quiet; then
50           echo "Code is properly formatted"
51       else
52           git diff --color=always
53           echo 'style diverges, please run gst-indent first'
54           exit 1
55       fi
56   except:
57     variables:
58       # No point on trying to format C files in those repositories
59       - $CI_PROJECT_NAME == "gstreamer-sharp"
60       - $CI_PROJECT_NAME == "cerbero"
61
62 .build:
63   stage: 'full builds'
64   dependencies:
65     - "manifest"
66   variables:
67     CC: "ccache gcc"
68     CXX: "ccache g++"
69     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
70     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
71     MAIN_DIR: "${CI_PROJECT_DIR}/validate-output/"
72     MESON_ARGS: "${DEFAULT_MESON_ARGS}"
73
74   script:
75     - ccache -z
76     # Not sure why, but permission errors else
77     # https://gitlab.freedesktop.org/alatiera/gstreamer/-/jobs/41441
78     - cp -r /gst-build/ . && cd gst-build
79     - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
80     - meson build/ $MESON_ARGS
81     - ninja -C build/
82     - ccache -s
83   after_script:
84     - cd gst-build/
85     # Clean the artifacts packages to avoid copying "useless" build products.
86     - test -d build && find build -name '*.[ao]' -delete
87     # Clean the .git repos since we won't need them anymore
88     - rm -rf subprojects/*/.git/
89     - rm -rf build/subprojects/*/.git/
90   cache:
91     key: "${CI_JOB_NAME}"
92     paths:
93       - "${CCACHE_DIR}"
94   artifacts:
95     expire_in: 6hours
96     when: always
97     paths:
98       - "manifest.xml"
99       - "gst-build/"
100   except:
101     variables:
102       - $CI_PROJECT_NAME == "cerbero"
103
104 build fedora x86_64:
105   extends: '.build'
106   stage: 'build'
107   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:6f7e01e1e30a73efa880acdc8e911f1f20c58dbb'
108
109 build android arm64 api28:
110   extends: '.build'
111   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/android_28:f085d34a32cb8cac95cbd420344efeaa647d08d5'
112   variables:
113     MESON_ARGS: >
114       -Dbad=enabled
115       -Dbad:androidmedia=enabled
116       --cross-file /android_arm64_28.txt
117   before_script:
118     - cat /android_arm64_28.txt
119
120 .test:
121   stage: 'test'
122   variables:
123     MAIN_DIR: "${CI_PROJECT_DIR}/validate-output/"
124     # Disable colored output to avoid weird rendering issues
125     GST_DEBUG_COLOR: 'no'
126
127     # note the -b at the start of each line
128     # Can't comment inline sadly
129     # FIXME: get this into gst-validate-launcher KNOWN_ISSUES
130     # check.gst-plugins-base.elements_multisocketsink.test_sending_buffers_with_9_gstmemories: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/525
131     # souphttpsrc.test_icy_stream: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/307
132     # h264parse: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/842
133     # rtspserver.test_shared_tcp: https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/54
134     # dtls: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/811
135     # mpegtsmux.test_align: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/844
136     BLACKLIST: >
137       -b check.gst-plugins-base.elements_multisocketsink.test_sending_buffers_with_9_gstmemories
138       -b check.gst-plugins-good.elements_souphttpsrc.test_icy_stream
139       -b check.gst-plugins-bad.elements_h264parse.test_parse_packetized
140       -b check.gst-plugins-bad.elements_dtls.test_data_transfer
141       -b check.gst-plugins-bad.elements_dtls.test_create_and_unref
142       -b check.gst-rtsp-server.gst_rtspserver.test_shared_tcp
143   script:
144     - cd gst-build/
145     - >
146       ./gst-uninstalled.py
147       gst-validate-launcher ${TEST_SUITE}
148       -fs
149       -j=1
150       --mute
151       --shuffle
152       --no-display
153       --dump-on-failure
154       --meson-no-rebuild
155       -M "${CI_PROJECT_DIR}/validate-output/"
156       --xunit-file "${CI_PROJECT_DIR}/validate-output/logs/xunit.xml"
157       ${BLACKLIST}
158   artifacts:
159     expire_in: 2 days
160     when: always
161     paths:
162       - 'gst-build/build/meson-logs/'
163       - 'validate-output/logs'
164     reports:
165       junit:
166         - "validate-output/logs/*.xml"
167   # We disable the .build above, which this job usually depends upon for cerbero
168   except:
169     variables:
170       - $CI_PROJECT_NAME == "cerbero"
171
172 .test fedora x86_64:
173   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:6f7e01e1e30a73efa880acdc8e911f1f20c58dbb'
174   extends: '.test'
175   dependencies:
176     - build fedora x86_64
177
178 check fedora:
179   extends: '.test fedora x86_64'
180   variables:
181     TEST_SUITE: "check.gst*"
182
183 # Template for Cerbero GStreamer Build
184 #
185 # Parameters:
186 # CONFIG: The name of the configuration file to use
187 # ARCH: The cerbero <distro>_<cpu> (used in cache key)
188 #
189 # Produces runtime and devel tarball packages.
190 .cerbero:
191   stage: "full builds"
192   dependencies:
193     - "manifest"
194   variables:
195     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
196     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
197     CCACHE_MAXSIZE: "1.7G"
198     CERBERO_HOME: "${CI_PROJECT_DIR}/cerbero-build"
199     CERBERO_SOURCES: "${CI_PROJECT_DIR}/cerbero-sources"
200     CERBERO_DEPS: "cerbero-deps.tar.gz"
201     CERBERO: ./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml
202   before_script:
203     # FIXME Wrong namespace
204     # Workaround build-tools having hardcoded internal path 
205     - mkdir -p /builds/gstreamer
206     - ln -sf ${CI_PROJECT_DIR} /builds/gstreamer/cerbero
207     - rsync -aH /cerbero/ .
208     - mkdir -p ${CERBERO_HOME}
209     - test -f ${CERBERO_DEPS} && tar -C ${CERBERO_HOME} -xf ${CERBERO_DEPS}
210     - echo "home_dir = \"${CERBERO_HOME}\"" >> localconf.cbc
211     - echo "local_sources = \"${CERBERO_SOURCES}\"" >> localconf.cbc
212     - ./cerbero-uninstalled --self-update manifest.xml
213     - ccache -z
214   script:
215     - $CERBERO show-config
216     - $CERBERO fetch-bootstrap --build-tools-only
217     - $CERBERO fetch-package --deps --reset-rdeps --full-reset gstreamer-1.0
218     - $CERBERO fetch-cache
219     - $CERBERO bootstrap --offline --build-tools-only
220     - $CERBERO package --offline -t -o ${CI_PROJECT_DIR} gstreamer-1.0
221     - ccache -s
222   cache:
223     key: "cerbero_${ARCH}"
224     paths:
225       - "${CCACHE_DIR}"
226       - "${CERBERO_SOURCES}"
227   artifacts:
228     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
229     expire_in: '2 days'
230     when: 'always'
231     paths:
232       - "manifest.xml"
233       - "cerbero-build/logs"
234       - "*.tar.bz2"
235
236 # Template for Cerbero GStreamer Deps
237 #
238 # This template is used by cerbero/ project to pre-built the GStreamer
239 # depedencies. When available, the .cerbero jobs will download this artifact
240 # in order to speed up the build.
241 #
242 # Parameters:
243 # CONFIG: The name of the configuration file to use
244 # ARCH: The architecture name (Cerbero naming)
245 #
246 # Produce an artifact with the dist/ and .cache for the ARCH along
247 # with the associated build-tools.
248 .cerbero deps:
249   extends: .cerbero
250   stage: "build"
251   script:
252     - $CERBERO show-config
253     - $CERBERO fetch-bootstrap --build-tools-only
254     - $CERBERO fetch-package --deps gstreamer-1.0
255     - $CERBERO bootstrap --offline --build-tools-only
256     - $CERBERO build-deps --offline
257           gstreamer-1.0 gst-plugins-base-1.0 gst-plugins-good-1.0
258           gst-plugins-bad-1.0 gst-plugins-ugly-1.0 gst-rtsp-server-1.0
259           gst-libav-1.0 gst-validate gst-editing-services-1.0 libnice
260     - $CERBERO fetch-cache --skip-fetch --job-id=${CI_JOB_ID}
261     - tar -C ${CERBERO_HOME} -czf $CERBERO_DEPS
262               build-tools build-tools.cache
263               dist/${ARCH} ${ARCH}.cache
264     - ccache -s
265   only:
266     variables:
267       - $CI_PROJECT_NAME == "cerbero"
268   artifacts:
269     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
270     expire_in: '10 days'
271     when: 'always'
272     paths:
273       - "manifest.xml"
274       - "cerbero-build/logs"
275       - "cerbero-build/cerbero-deps.log"
276       - "${CERBERO_DEPS}"
277
278 .build cerbero fedora x86_64:
279   extends: '.cerbero'
280   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/cerbero-fedora:d19082b72667fb3382bdc3621520c4d26e258b2e'
281   variables:
282     CONFIG: "linux.config"
283     ARCH: "linux_x86_64"
284
285 .cerbero deps fedora x86_64:
286   extends: '.cerbero deps'
287   image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/cerbero-fedora:d19082b72667fb3382bdc3621520c4d26e258b2e'
288   variables:
289     CONFIG: "linux.config"
290     ARCH: "linux_x86_64"
291
292 # This indirection allow overriding the image without passing again CONFIG and ARCH
293 build cerbero fedora x86_64:
294   extends: '.build cerbero fedora x86_64'