stages:
- build
- test
- deploy
variables:
CARGO_HOME: .cargo
Build crate:
stage: build
image: rustlang/rust:nightly
cache:
- key: global
paths:
- .cargo
- target
script:
- cargo update
- cargo clippy --no-deps
- cargo build --release
cargo test:
stage: test
image: rustlang/rust:nightly
cache:
- key: global
policy: pull
paths:
- .cargo
- target
script:
- cargo test --release
cargo doc:
stage: test
image: rustlang/rust:nightly
script:
- cargo doc --no-deps
Publish crate:
stage: deploy
image: rustlang/rust:nightly
script:
- sh -c 'cargo login "${CARGO_TOKEN}" && cargo publish'
only:
- tags