2022-07-15 21:27:25 +12:00
|
|
|
image: rust:latest
|
2022-07-15 22:27:26 +12:00
|
|
|
stages:
|
2022-07-15 21:27:25 +12:00
|
|
|
- dependencies
|
|
|
|
- test
|
|
|
|
- release
|
|
|
|
|
|
|
|
build:
|
|
|
|
stage: dependencies
|
|
|
|
cache:
|
|
|
|
key: "$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- $HOME/.cargo
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- $HOME/.cargo
|
|
|
|
expire_in: 60 mins
|
|
|
|
script:
|
|
|
|
- cargo test --no-run --release
|
|
|
|
|
|
|
|
cargo test:
|
2022-07-15 22:27:26 +12:00
|
|
|
stage: test
|
2022-07-15 21:27:25 +12:00
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
script:
|
|
|
|
- rustc --version && cargo --version
|
|
|
|
- cargo test --jobs 1 --release
|
|
|
|
|
|
|
|
cargo clippy:
|
|
|
|
stage: test
|
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
before_script:
|
|
|
|
- rustup component add clippy
|
|
|
|
script:
|
|
|
|
- cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
# cargo publish:
|
|
|
|
# stage: release
|
|
|
|
# dependencies:
|
|
|
|
# - build
|
|
|
|
# only:
|
|
|
|
# - /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
|
|
# except:
|
|
|
|
# - branches
|
|
|
|
# script:
|
|
|
|
# - cargo publish --token $CARGO_TOKEN
|