Debian Codegraph @

.gitlab-ci/ci.template

raw
1 ## This file is generated. Do not modify
2
3 include:
4 - '/.gitlab-ci/tags.yml'
5 - project: "Infrastructure/freedesktop-ci-templates"
6 file: "templates/fedora.yml"
7 ref: "{{template_ref}}"
8 - project: "Infrastructure/freedesktop-ci-templates"
9 file: "templates/ci-fairy.yml"
10 ref: "{{template_ref}}"
11 - component: "gitlab.gnome.org/GNOME/citemplates/release-service@master"
12 inputs:
13 dist-job-name: build-{{targets["dist"]}}
14 # gupnp tags are always of the format {PROJECT_NAME}-{version}
15 tarball-artifact-path: "build/meson-dist/${CI_COMMIT_TAG}.tar.xz"
16 - project: "GNOME/citemplates"
17 file: "templates/default-rules.yml"
18
19 variables:
20 MESON_TEST_TIMEOUT_MULTIPLIER: 3
21
22 stages:
23 - review
24 - prepare
25 - build
26 - test
27 - website
28 - analysis
29 - deploy
30
31 .check-template: &check
32 extends:
33 - .fdo.ci-fairy
34 artifacts:
35 expire_in: 1 week
36 paths:
37 - check-junit-report.xml
38 reports:
39 junit: check-junit-report.xml
40
41 check-commit-log:
42 variables:
43 GIT_DEPTH: "100"
44 stage: review
45 script:
46 - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
47 then
48 ci-fairy check-commits --junit-xml=check-junit-report.xml ;
49 else
50 echo "Not a merge request" ;
51 fi
52 <<: *check
53
54 .build-template: &build
55 stage: build
56 script:
57 - meson . build --prefix=/usr -Db_coverage=true -Dgtk_doc=true
58 - ninja -C build
59 - meson dist -C build --no-tests
60 artifacts:
61 expire_in: 1 day
62 paths:
63 - build
64
65 .test-template: &test
66 stage: test
67 variables:
68 G_SLICE: "always-malloc"
69 MALLOC_CHECK_: "3"
70 script:
71 - cd build
72 - |
73 # Remove the many "CI_" variables from the environment. Meson dumps the
74 # whole environment for every failed test, and that gives a whole
75 # screenful of junk each time unless we strip these.
76 unset $(env|grep -o '^CI_[^=]*')
77 env LANG=C.UTF-8 LC_ALL=C.UTF-8 meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} --print-errorlogs ${MESON_TEST_EXTRA_ARGS}
78 after_script:
79 - |
80 echo "Distribution: "
81 echo
82 egrep '^NAME=|^VERSION=' /etc/os-release
83 echo
84 echo "Test suite settings:"
85 echo
86 echo "G_MESSAGES_DEBUG: ${G_MESSAGES_DEBUG}"
87 echo "MESON_TEST_EXTRA_ARGS: ${MESON_TEST_EXTRA_ARGS}"
88 echo
89 echo "These values can be set at https://gitlab.gnome.org/GNOME/{{project}}/pipelines/new"
90 artifacts:
91 expire_in: 1 day
92 when: always
93 paths:
94 - build
95 reports:
96 junit: "build/meson-logs/testlog.junit.xml"
97
98 {% for distro in distributions %}
99 {% for version in distributions[distro] %}
100 .{{project}}.{{distro}}@common:
101 variables:
102 BASE_TAG: '${{"{"}}{{distro|upper}}_BASE_TAG}'
103 FDO_UPSTREAM_REPO: GNOME/{{project}}
104 FDO_DISTRIBUTION_PACKAGES: "{{" ".join(packages[distro].needed)}}"
105 FDO_DISTRIBUTION_EXEC: .gitlab-ci/setup-image-{{distro}}.sh
106
107 .{{project}}.{{distro}}:{{version}}@{{arch}}:
108 extends: .{{project}}.{{distro}}@common
109 variables:
110 FDO_DISTRIBUTION_VERSION: "{{version}}"
111 FDO_DISTRIBUTION_TAG: "{{arch}}-${BASE_TAG}"
112
113 build-container-{{distro}}:{{version}}@{{arch}}:
114 extends:
115 - .fdo.container-build@{{distro}}
116 - .{{project}}.{{distro}}:{{version}}@{{arch}}
117 stage: prepare
118 variables:
119 GIT_STRATEGY: none
120
121 build-{{distro}}:{{version}}@{{arch}}:
122 extends:
123 - .fdo.distribution-image@{{distro}}
124 - .{{project}}.{{distro}}:{{version}}@{{arch}}
125 needs:
126 - build-container-{{distro}}:{{version}}@{{arch}}
127 <<: *build
128
129 test-{{distro}}:{{version}}@{{arch}}:
130 tags:
131 - ipv6
132 extends:
133 - .fdo.distribution-image@{{distro}}
134 - .{{project}}.{{distro}}:{{version}}@{{arch}}
135 needs:
136 - build-{{distro}}:{{version}}@{{arch}}
137 <<: *test
138 {% endfor %}
139 {% endfor %}
140
141 {% for downstream in triggers %}
142 trigger-{{downstream}}:
143 stage: analysis
144 needs:
145 - test-{{targets["downstream"]}}
146 trigger: {{triggers[downstream]}}
147 only:
148 - master
149 {% endfor %}
150
151 coverage-analysis:
152 extends:
153 - .fdo.distribution-image@{{targets["coverage"].split(":")[0]}}
154 - .{{project}}.{{targets["coverage"]}}
155 stage: analysis
156 allow_failure: true
157 script:
158 - cd build
159 - mkdir -p coveragereport
160 - gcovr --html-details --print-summary --root=.. --exclude=../docs/reference --exclude=../tests --exclude=../tools --exclude=../examples --output coveragereport/index.html
161 coverage: '/^lines: (\d+\.\d+\%)/'
162 artifacts:
163 when: always
164 paths:
165 - build/coveragereport
166 needs:
167 - test-{{targets["coverage"]}}
168
169 static-scan:
170 extends:
171 - .fdo.distribution-image@{{targets["static-scan"].split(":")[0]}}
172 - .{{project}}.{{targets["static-scan"]}}
173 stage: analysis
174 needs:
175 - build-container-{{targets["static-scan"]}}
176 script:
177 - meson --buildtype=debug _scan_build -Dintrospection=false
178 - export SCANBUILD="$PWD/.gitlab-ci/scanbuild-wrapper.sh"
179 - ninja -C _scan_build scan-build
180 artifacts:
181 paths:
182 - _scan_build/meson-logs
183 after_script:
184 - .gitlab-ci/scanbuild-plist-to-junit.py _scan_build/meson-logs/scanbuild/ > _scan_build/junit-scan-build.xml
185 artifacts:
186 reports:
187 junit: "_scan_build/junit-scan-build.xml"
188
189 coverity:
190 extends:
191 - .fdo.distribution-image@{{targets["coverity"].split(":")[0]}}
192 - .{{project}}.{{targets["coverity"]}}
193 stage: analysis
194 allow_failure: true
195 script:
196 - curl https://scan.coverity.com/download/linux64 --data "token=$COVERITY_TOKEN&project={{project}}" --output /tmp/coverity_tool.tgz
197 - tar zxf /tmp/coverity_tool.tgz
198 - mkdir coverity-build
199 - cd coverity-build
200 - env CC=clang meson ..
201 - ../cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
202 - tar czf cov-int.tar.gz cov-int
203 - curl https://scan.coverity.com/builds?project={{project}}
204 --form token=$COVERITY_TOKEN --form [email protected]
205 --form [email protected] --form version="`git describe --tags`"
206 --form description="gitlab CI build"
207 needs:
208 - build-container-{{targets["coverity"]}}
209 only:
210 - master
211 except:
212 changes:
213 - po/*.po
214
215 pages:
216 extends:
217 - .fdo.distribution-image@{{targets["pages"].split(":")[0]}}
218 - .{{project}}.{{targets["pages"]}}
219 stage: website
220 script:
221 - mkdir -p public
222 - mv build/doc/{{project}}-{{api_version}} public/docs
223
224 artifacts:
225 paths:
226 - public
227 needs:
228 - build-{{targets["pages"]}}
229 rules:
230 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
231 - if: $CI_COMMIT_BRANCH == /^wip\/.*\/ci.*$/
232 - if: $CI_COMMIT_BRANCH == /^wip\/.*\/.*doc.*$/
233
234