stages: - test - lint - pages .cargo_test_template: &cargo_test stage: test variables: RUST_BACKTRACE: "FULL" before_script: - mkdir -p .cargo_cache # Only stuff inside the repo directory can be cached # Override the CARGO_HOME variable to force it location - export CARGO_HOME="${PWD}/.cargo_cache" script: - rustc -Vv && cargo -Vv - cargo build - cargo test # - cargo test -- --ignored cache: # JOB_NAME - Each job will have it's own cache # COMMIT_REF_SLUG = Lowercase name of the branch # ^ Keep diffrerent caches for each branch key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" paths: - target/ - .cargo_cache/ # stable:test: # # https://hub.docker.com/_/rust/ # image: "rust" # <<: *cargo_test nightly:test: # https://hub.docker.com/r/rustlang/rust/ image: "rustlang/rust:nightly" <<: *cargo_test # Configure and run rustfmt on nightly # Exits and builds fails if on bad format rustfmt: image: "registry.gitlab.com/alatiera/rustfmt-oci-image/rustfmt:nightly" stage: lint script: - rustc -Vv && cargo -Vv - mkdir mixed_tests/auto - echo >> mixed_tests/auto/mod.rs - cargo fmt --version - cargo fmt --all -- --check pages: # https://hub.docker.com/r/rustlang/rust/ image: "rustlang/rust:nightly" stage: pages script: - mkdir public - cargo install mdbook --no-default-features - mdbook build ./doc-internals - cp -r ./doc-internals/book/* ./public - find $PWD/public | grep "\.html\$" artifacts: paths: - public only: - master