-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
85 lines (77 loc) · 1.66 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
image: "rust:slim"
stages:
- check
- build
- test
- release
# Variable defaults
variables:
RUST_VERSION: stable
# Install compiler and OpenSSL dependencies
before_script:
- |
rustup install $RUST_VERSION
rustup default $RUST_VERSION
- |
rustc --version
cargo --version
# Check on stable, beta, nightly and MSRV
.check-base: &check-base
stage: check
script:
- cargo check --verbose
check-stable:
<<: *check-base
check-beta:
<<: *check-base
variables:
RUST_VERSION: beta
check-nightly:
<<: *check-base
variables:
RUST_VERSION: nightly
check-msrv:
<<: *check-base
variables:
RUST_VERSION: "1.56.0"
# Build on stable
build:
stage: build
needs: []
dependencies: []
script:
- cargo build --release --verbose
# Test on stable
test:
stage: test
needs: []
dependencies: []
script:
- cargo test --verbose
# Gather test coverage
test-coverage:
stage: test
needs: []
dependencies: []
coverage: '/^\d+.\d+% coverage/'
script:
- apt-get update
- apt-get install -y --no-install-recommends pkg-config libssl-dev
- cargo install cargo-tarpaulin -f
- |
if [ -z "$COVERALLS_TOKEN" ]; then
cargo tarpaulin --verbose --avoid-cfg-tarpaulin --out Xml;
else
cargo tarpaulin --verbose --avoid-cfg-tarpaulin --coveralls $COVERALLS_TOKEN --out Xml;
fi
# Release crate on crates.io
release-crate:
stage: release
dependencies: []
only:
- /^v(\d+\.)*\d+$/
script:
- echo "Creating release crate to publish on crates.io..."
- echo $CARGO_TOKEN | cargo login
- echo "Publishing crate to crates.io..."
- cargo publish --verbose --allow-dirty