1stages: 2 - test 3 4 5.setup_template: &setup_template 6 stage: test 7 image: debian:stable-slim 8 before_script: 9 - export CARGO_HOME="$CI_PROJECT_DIR/.cargo" 10 - export PATH="$PATH:$CARGO_HOME/bin" 11 - export RUST_BACKTRACE=full 12 - apt-get update > /dev/null 13 - apt-get install -y curl build-essential > /dev/null 14 - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_VERSION 15 - rustup --version 16 - rustc --version 17 - cargo --version 18 19.test_all_template: &test_all_template 20 <<: *setup_template 21 script: 22 - cargo test --all 23 24 25test-stable: 26 <<: *test_all_template 27 variables: 28 RUST_VERSION: stable 29 30test-beta: 31 <<: *test_all_template 32 variables: 33 RUST_VERSION: beta 34 35test-nightly: 36 <<: *test_all_template 37 variables: 38 RUST_VERSION: nightly 39 40 41test-1.31.0: 42 <<: *setup_template 43 script: 44 - cargo test --tests # skip doctests 45 variables: 46 RUST_VERSION: 1.31.0 47 48test-fmt: 49 <<: *setup_template 50 script: 51 - cargo fmt --all -- --check 52 variables: 53 RUST_VERSION: stable 54