blob: ad3320ecd4587531342c11d5cd5acb05a1c1f510 [file] [log] [blame]
stages:
- test
.setup_template: &setup_template
stage: test
image: debian:stable-slim
cache:
key: $RUST_VERSION
paths:
- .cargo/
- target/
before_script:
- export CARGO_HOME="$CI_PROJECT_DIR/.cargo"
- export PATH="$PATH:$CARGO_HOME/bin"
- export RUST_BACKTRACE=full
- apt-get update > /dev/null
- apt-get install -y curl build-essential > /dev/null
- curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VERSION
- rustup --version
- rustc --version
- cargo --version
.test_all_template: &test_all_template
<<: *setup_template
script:
- cargo test --all
test-stable:
<<: *test_all_template
variables:
RUST_VERSION: stable
test-beta:
<<: *test_all_template
variables:
RUST_VERSION: beta
test-nightly:
<<: *test_all_template
variables:
RUST_VERSION: nightly
test-1.31.0:
<<: *setup_template
script:
- cargo test --tests # skip doctests
variables:
RUST_VERSION: 1.31.0
test-fmt:
<<: *setup_template
script:
- rustup component add rustfmt
- cargo fmt --all -- --check
variables:
RUST_VERSION: stable