-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path.gitlab-ci.yml
73 lines (67 loc) · 2.21 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
stages:
- containers
- builds
- sanity_checks
.native_git_build_job:
extends:
- .gitlab_native_build_job
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export SCRATCH_DIR="/tmp/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 RUSTFLAGS="-D warnings"
- export RUSTDOCFLAGS="-D warnings"
- 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
- cargo test --verbose
- cargo test --verbose --features ${LIBVIRT_RUST_TEST_FEATURES:-qemu}
- cargo test --verbose --manifest-path=virt-sys/Cargo.toml
- cargo test --doc --verbose --features qemu
- cargo test --doc --verbose --manifest-path=virt-sys/Cargo.toml
- cargo doc
- cargo doc --features qemu
.native_build_job:
extends:
- .gitlab_native_build_job
script:
- export RUSTFLAGS="-D warnings"
- export RUSTDOCFLAGS="-D warnings"
- cargo test --verbose --features ${LIBVIRT_RUST_TEST_FEATURES:-qemu}
- cargo test --verbose --manifest-path=virt-sys/Cargo.toml
- if test "$CLIPPY" = "enable"; then
cargo clippy --quiet --no-deps --all-targets >cargo-clippy.txt 2>&1 || true ;
if test -s cargo-clippy.txt; then
echo "clippy error, see cargo-clippy.txt artifact for details";
exit 1;
fi;
fi
- if test "$DOC" = "enable"; then
if ! cargo doc 2> cargo-doc.txt || ! cargo doc --features qemu 2>> cargo-doc.txt ; then
echo "cargo doc error, see cargo-doc.txt artifact for details";
exit 1;
fi;
fi
artifacts:
paths:
- cargo-clippy.txt
- cargo-doc.txt
expire_in: 1 week
when: on_failure
.cross_build_job:
extends:
- .gitlab_cross_build_job
script:
- export RUSTFLAGS="-D warnings"
- export RUSTDOCFLAGS="-D warnings"
- cargo build --verbose --target $RUST_TARGET
include: '/ci/gitlab.yml'