-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
64 lines (57 loc) · 1.24 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
# GitLab CI configuration for xerus
image: "rust:slim"
stages:
- check
- build
- test
# Variable defaults
variables:
RUST_VERSION: stable
RUST_TARGET: x86_64-unknown-linux-gnu
# Install compiler and OpenSSL dependencies
before_script:
- apt-get update
- apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev
- |
rustup install $RUST_VERSION
rustup default $RUST_VERSION
- |
rustc --version
cargo --version
# Check on stable, beta and nightly
.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
# Build using stable
build-x86_64-linux-gnu:
stage: build
needs:
- check-stable
script:
- cargo build --target=$RUST_TARGET --release --verbose
- mv target/$RUST_TARGET/release/xerus ./xerus-$RUST_TARGET
- strip -g ./xerus-$RUST_TARGET
artifacts:
name: xerus-x86_64-linux-gnu
paths:
- xerus-$RUST_TARGET
expire_in: 1 month
# Run the unit tests through Cargo
test-cargo:
stage: test
needs:
- check-stable
dependencies: []
script:
- cargo test --verbose