forked from libvirt/libvirt-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
100 lines (88 loc) · 2.6 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
stages:
- containers
- builds
- sanity_checks
.git_build_vars: &git_build_vars |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export SCRATCH_DIR="$PWD/scratch"
export VROOT="$SCRATCH_DIR/vroot"
export LIBDIR="$VROOT/lib"
export LD_LIBRARY_PATH="$LIBDIR"
export PATH="$VROOT/bin:$PATH"
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
export CFLAGS="-Werror"
.native_git_build_job:
script:
- *git_build_vars
- pushd "$PWD"
- mkdir -p "$SCRATCH_DIR"
- cd "$SCRATCH_DIR"
- git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
- cd libvirt
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- popd
- $PYTHON setup.py build
- $PYTHON -m pip install .
- $PYTHON setup.py test
- $PYTHON setup.py sdist
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ;
fi
.native_git_build_job_prebuilt_env:
extends:
- .native_git_build_job
- .gitlab_native_build_job_prebuilt_env
.native_git_build_job_local_env:
extends:
- .native_git_build_job
- .gitlab_native_build_job_local_env
.native_build_job:
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON setup.py build
- $PYTHON -m pip install .
- $PYTHON setup.py test
- $PYTHON setup.py sdist
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
mv rpmbuild/RPMS/x86_64/ libvirt-python-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
include: '/ci/gitlab.yml'
.api_coverage_job:
stage: sanity_checks
script:
- *git_build_vars
- LIBVIRT_API_COVERAGE=1 $PYTHON setup.py test
allow_failure: true
api_coverage_prebuilt_env:
extends:
- .gitlab_native_build_job_prebuilt_env
- .api_coverage_job
needs:
- job: x86_64-centos-stream-8-git-prebuilt-env
artifacts: true
variables:
NAME: centos-stream-8
api_coverage_local_env:
extends:
- .gitlab_native_build_job_local_env
- .api_coverage_job
needs:
- job: x86_64-centos-stream-8-git-local-env
artifacts: true
variables:
IMAGE: quay.io/centos/centos:stream8
NAME: centos-stream-8