gitlab: ensure all meson jobs capture build/meson-logs by default
The build-without-defaults and build-tci jobs do not capture any artifacts, despite running 'make check'. This has proved a repeated bug with CI jobs, so introduce a new '.meson_job_template' rule which always captures 'build/meson-logs'. Jobs can still provide their own 'artifacts:' config which will override this default behaviour. Acked-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé committed
Mar 3, 2026 at 18:50 UTC
0776aed56afacfbb7a3e4d03e3331d098adc927c
1 file changed
+19
-11
.gitlab-ci.d/buildtest-template.yml
+19
-11
@@ -1,5 +1,20 @@
1
-.native_build_job_template:
1
+
2
+# Any job running meson should capture meson logs
3
+# by default. Some jobs might override the artifacts
4
+# to capture further files
5
+.meson_job_template:
6
extends: .base_job_template
7
+ artifacts:
8
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
9
+ when: always
10
+ expire_in: 7 days
11
+ paths:
12
+ - build/meson-logs
13
+ reports:
14
+ junit: build/meson-logs/*.junit.xml
15
+
16
+.native_build_job_template:
17
+ extends: .meson_job_template
18
stage: build
19
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
20
cache:
@@ -60,7 +75,7 @@
75
- build/**/*.c.o.d
76
77
.common_test_job_template:
63
- extends: .base_job_template
78
+ extends: .meson_job_template
79
stage: test
80
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
81
script:
@@ -87,14 +102,7 @@
102
# Prevent logs from the build job that run earlier
103
# from being duplicated in the test job artifacts
104
- rm -f build/meson-logs/*
90
- artifacts:
91
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
92
- when: always
93
- expire_in: 7 days
94
- paths:
95
- - build/meson-logs
96
- reports:
97
- junit: build/meson-logs/*.junit.xml
105
+
106
107
.functional_test_job_template:
108
extends: .common_test_job_template
@@ -125,7 +133,7 @@
133
QEMU_JOB_FUNCTIONAL: 1
134
135
.wasm_build_job_template:
128
- extends: .base_job_template
136
+ extends: .meson_job_template
137
stage: build
138
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
139
before_script: