image: "$STABLE_TOOLCHAIN_IMAGE"
stages:
- test
- doc
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
RUSTUP_HOME: $CI_PROJECT_DIR/rustup
STABLE_TOOLCHAIN_IMAGE: "rust:slim"
NIGHTLY_TOOLCHAIN_IMAGE: "rustlang/rust:nightly-slim"
.rust_template: &rust_template
tags:
- amd64
- docker-runner
cache:
key: "$CI_JOB_NAME"
paths:
- cargo/
- rustup/
before_script:
- env
- pwd
- ls -l
- "rustup default $RUSTUP_TOOLCHAIN"
- rustup --version
- rustc --version
- cargo --version
.rust_test_template: &rust_test_template
<<: *rust_template
stage: test
script:
- cargo install cargo-junit
- cargo junit --name report.xml
artifacts:
reports:
junit: report.xml
test-stable:
<<: *rust_test_template
image: "$STABLE_TOOLCHAIN_IMAGE"
variables:
RUSTUP_TOOLCHAIN: "stable"
test-nightly:
<<: *rust_test_template
image: "$NIGHTLY_TOOLCHAIN_IMAGE"
allow_failure: true
variables:
RUSTUP_TOOLCHAIN: "nightly"
pages:
<<: *rust_template
stage: doc
image: "$STABLE_TOOLCHAIN_IMAGE"
variables:
RUSTUP_TOOLCHAIN: "nightly"
script:
- cargo doc --no-deps
- mv target/doc public
- echo '<meta http-equiv="refresh" content="0; url=rudoku_core">' > public/index.html
artifacts:
paths:
- public
only:
- master