-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
99 lines (93 loc) · 3.13 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
stages:
- containers
- builds
- sanity_checks
.script_variables: &script_variables |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export SCRATCH_DIR="/tmp/scratch"
export VROOT="$SCRATCH_DIR/vroot"
export LIBDIR="$VROOT/lib"
export CCACHE_DIR="$PWD/ccache"
export CCACHE_MAXSIZE="500M"
export PATH="$CCACHE_WRAPPERSDIR:$VROOT/bin:$PATH"
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
export LD_LIBRARY_PATH="$LIBDIR"
export XDG_DATA_DIRS="$VROOT/share:/usr/share"
export GI_TYPELIB_PATH="$LIBDIR/girepository-1.0"
.native_git_build_job:
extends:
- .gitlab_native_build_job
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- *script_variables
- pushd "$PWD"
- mkdir -p "$SCRATCH_DIR"
- cd "$SCRATCH_DIR"
- git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
- git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git
- cd libvirt
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- cd ../libvirt-glib
- meson build "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- popd
- meson build --fatal-meson-warnings -Dwerror=true --prefix="$VROOT"
- $NINJA -C build
- $NINJA -C build install;
- if test "$TESTS" != "skip";
then
$NINJA -C build test;
$NINJA -C build dist;
fi
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/libvirt-dbus*.tar.xz;
fi
.native_build_job:
extends:
- .gitlab_native_build_job
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- *script_variables
- meson build --fatal-meson-warnings -Dwerror=true --prefix="$VROOT"
- $NINJA -C build
- $NINJA -C build install;
- if test "$TESTS" != "skip";
then
$NINJA -C build test;
$NINJA -C build dist;
fi
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/libvirt-dbus*.tar.xz;
fi
include: '/ci/gitlab.yml'
.coverity:
extends:
- .gitlab_native_build_job
needs:
- job: x86_64-almalinux-8-container
optional: true
variables:
IMAGE: docker.io/library/almalinux:8
NAME: almalinux-8
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 build
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -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"
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
when: never
- if: '$COVERITY_SCAN_PROJECT_NAME == null || $COVERITY_SCAN_TOKEN == null'
when: never
- !reference [.gitlab_native_build_job, rules]