blob: 33a65393be5806567aba332cc520ff22debf4877 [file] [log] [blame]
stages:
- test
.rust_test_template: &rust_test_template
stage: test
image: debian:stable-slim
cache:
key: $RUSTUP_TOOLCHAIN
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 $RUSTUP_TOOLCHAIN
- rustup --version
- rustc --version
- cargo --version
test-stable:
<<: *rust_test_template
script:
- cargo test --all
variables:
RUSTUP_TOOLCHAIN: stable
test-beta:
<<: *rust_test_template
script:
- cargo test --all
variables:
RUSTUP_TOOLCHAIN: beta
test-nightly:
<<: *rust_test_template
script:
- cargo test --all
variables:
RUSTUP_TOOLCHAIN: nightly
test-1.31.0:
<<: *rust_test_template
script:
- cargo test --tests # skip doctests
variables:
RUSTUP_TOOLCHAIN: 1.31.0
test-fmt:
<<: *rust_test_template
variables:
RUSTUP_TOOLCHAIN: stable
script:
- rustup component add rustfmt
- cargo fmt --all -- --check