forked from libvirt/libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
195 lines (175 loc) · 5.02 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
variables:
GIT_DEPTH: 100
stages:
- containers
- builds
- integration_tests
- sanity_checks
.script_variables: &script_variables |
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
export CCACHE_MAXSIZE="500M"
export PATH="$CCACHE_WRAPPERSDIR:$PATH"
export VIR_TEST_VERBOSE="1"
export VIR_TEST_DEBUG="1"
include:
- '/ci/gitlab.yml'
- '/ci/integration.yml'
.native_build_job:
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- source ci/jobs.sh
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
run_rpmbuild;
else
run_build;
run_test;
fi
after_script:
- test "$CI_JOB_STATUS" != "success" && exit 1;
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
mv "$HOME"/rpmbuild/RPMS/x86_64/ libvirt-rpms/;
fi
.native_build_job_prebuilt_env:
extends:
- .native_build_job
- .gitlab_native_build_job_prebuilt_env
.native_build_job_local_env:
extends:
- .native_build_job
- .gitlab_native_build_job_local_env
.cross_build_job:
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- source ci/jobs.sh
- run_build
- if test "$CROSS" = "i686" ;
then
run_test;
fi
.cross_build_job_prebuilt_env:
extends:
- .cross_build_job
- .gitlab_cross_build_job_prebuilt_env
.cross_build_job_local_env:
extends:
- .cross_build_job
- .gitlab_cross_build_job_local_env
# This artifact published by this job is downloaded by libvirt.org to
# be deployed to the web root:
# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=website
.website_job:
script:
- source ci/jobs.sh
- run_website_build
after_script:
- test "$CI_JOB_STATUS" != "success" && exit 1;
- mv install/usr/share/doc/libvirt/html/ website
artifacts:
expose_as: 'Website'
name: 'website'
when: on_success
expire_in: 30 days
paths:
- website
website_prebuilt_env:
extends:
- .website_job
- .gitlab_native_build_job_prebuilt_env
needs:
- job: x86_64-almalinux-8-container
optional: true
variables:
NAME: almalinux-8
website_local_env:
extends:
- .website_job
- .gitlab_native_build_job_local_env
variables:
IMAGE: docker.io/library/almalinux:8
NAME: almalinux-8
.codestyle_job:
stage: sanity_checks
script:
- source ci/jobs.sh
- run_codestyle
codestyle_prebuilt_env:
extends:
- .codestyle_job
- .gitlab_native_build_job_prebuilt_env
needs:
- job: x86_64-opensuse-leap-15-container
optional: true
variables:
NAME: opensuse-leap-15
codestyle_local_env:
extends:
- .codestyle_job
- .gitlab_native_build_job_local_env
variables:
IMAGE: registry.opensuse.org/opensuse/leap:15.4
NAME: opensuse-leap-15
# This artifact published by this job is downloaded to push to Weblate
# for translation usage:
# https://gitlab.com/libvirt/libvirt/-/jobs/artifacts/master/download?job=potfile
potfile:
image: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
stage: builds
variables:
NAME: almalinux-8
before_script:
- cat /packages.txt
needs:
- job: x86_64-almalinux-8-container
optional: true
rules:
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
- when: never
before_script:
- *script_variables
script:
- source ci/jobs.sh
- run_potfile
after_script:
- test "$CI_JOB_STATUS" != "success" && exit 1;
- cp po/libvirt.pot libvirt.pot
artifacts:
expose_as: 'Potfile'
name: 'potfile'
when: on_success
expire_in: 30 days
paths:
- libvirt.pot
# Coverity job that is run only by schedules
coverity:
image: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
stage: builds
needs:
- job: x86_64-almalinux-8-container
optional: true
before_script:
- cat /packages.txt
script:
- curl https://scan.coverity.com/download/linux64 --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN -o /tmp/cov-analysis-linux64.tgz
- tar xfz /tmp/cov-analysis-linux64.tgz
- meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
- cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C build
- tar cfz cov-int.tar.gz cov-int
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL --form [email protected] --form version="$(git describe --tags)" --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
variables:
NAME: almalinux-8
rules:
- if: '$COVERITY_SCAN_PROJECT_NAME == null || $COVERITY_SCAN_TOKEN == null'
when: never
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
when: on_success
- when: never