image: "rust:slim"
stages:
- check
- build
- test
variables:
RUST_VERSION: stable
RUST_TARGET: x86_64-unknown-linux-gnu
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-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-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
test-cargo:
stage: test
needs:
- check-stable
dependencies: []
script:
- cargo test --verbose