-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
119 lines (111 loc) · 3.5 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
119 lines (111 loc) · 3.5 KB
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
stages:
- containers
- builds
- sanity_checks
- pages
.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:
extends:
- .gitlab_native_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 -m build -n -x
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- test-venv/bin/python -m pytest tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
unset CFLAGS ;
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:
extends:
- .gitlab_native_build_job
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON -m build -n -x
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- test-venv/bin/python -m pytest tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
unset CFLAGS ;
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt[-_]python*tar.gz ;
mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ;
fi
include: '/ci/gitlab.yml'
# Build Sphinx HTML API docs.
py_api_docs:
extends:
- .gitlab_native_build_job
needs:
- job: x86_64-fedora-44-container
optional: true
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON -m build -n -x
- $PYTHON -m venv docs-venv --system-site-packages --symlinks
- docs-venv/bin/python -m pip install dist/libvirt_python*.whl
- docs-venv/bin/python -m pip install -r requirements-docs.txt
- docs-venv/bin/sphinx-build -b html docs/ py_api_docs
artifacts:
expose_as: 'py_api_docs'
name: 'py_api_docs'
when: on_success
expire_in: 30 days
paths:
- py_api_docs
variables:
NAME: fedora-44
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:44
# Publish "py_api_docs" output via GitLab Pages
pages:
stage: pages
script:
- mv py_api_docs public
dependencies:
- py_api_docs
rules:
- if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
- when: never
artifacts:
expose_as: 'pages'
name: 'pages'
paths:
- public
api_coverage_job:
extends:
- .gitlab_native_build_job
needs:
- job: x86_64-centos-stream-9-git
artifacts: true
stage: sanity_checks
script:
- *git_build_vars
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- LIBVIRT_API_COVERAGE=1 test-venv/bin/python -m pytest tests
allow_failure: true
variables:
NAME: centos-stream-9
TARGET_BASE_IMAGE: quay.io/centos/centos:stream9