-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
75 lines (67 loc) · 2.25 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
# before_script:
# - apt-get update -yqq
# - apt-get install -yqq --no-install-recommends build-essential
.cargo_test_template: &cargo_test
stage: test
script:
- rustc --version && cargo --version
- cargo build
- cargo test --verbose -- --test-threads=1
- cargo test --verbose -- --test-threads=1 --ignored
test:stable:
# Stable img
# https://hub.docker.com/_/rust/
image: "rust"
<<: *cargo_test
test:nightly:
# Nightly
# https://hub.docker.com/r/rustlang/rust/
image: "rustlang/rust:nightly"
<<: *cargo_test
musl:stable:
# Stable img
# https://hub.docker.com/r/ekidd/rust-musl-builder/
image: "ekidd/rust-musl-builder"
<<: *cargo_test
# Configure and run rustfmt on nightly
# Exits and builds fails if on bad format
rustfmt:
image: "rustlang/rust:nightly"
before_script:
- rustup component add rustfmt-preview
- rustc --version
- cargo --version
- cargo fmt --version
script:
- cargo fmt --all -- --check
allow_failure: true
# Configure and run clippy on nightly
# Only fails on errors atm.
clippy:
image: "rustlang/rust:nightly"
before_script:
- rustup component add clippy-preview
- rustc --version
- cargo --version
- cargo clippy --version
script:
- cargo clippy --all
allow_failure: true
kcov:
# Stable img
# https://hub.docker.com/_/rust/
variables:
RUSTFLAGS: "-C link-dead-code"
image: "rust"
before_script:
# kcov
- apt-get update -yqq
- apt-get install -yqq libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo build --all
- cargo test --all --verbose
# - cargo test --all --verbose --jobs 1
allow_failure: true
after_script:
- wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xzf master.tar.gz && cd kcov-master && mkdir build && cd build && cmake .. && make && make install DESTDIR=../../kcov-build && cd ../.. && rm -rf kcov-master && for file in target/debug/rfc822_sanitizer-*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done && bash <(curl -s https://codecov.io/bash) && echo "Uploaded code coverage"