mirror of
https://gitlab.com/flio/rustation-ng.git
synced 2025-04-02 10:31:55 -04:00
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
# Setup a cache to cache job parts between jobs to ensure faster builds
|
|
cache:
|
|
key: "$CI_JOB_NAME"
|
|
untracked: true
|
|
paths:
|
|
- $HOME/.cargo/
|
|
- target/
|
|
|
|
# Define a yaml template for running a build and then running your tests
|
|
.cargo_test_template: &cargo_test
|
|
script:
|
|
- rustc --version && cargo --version
|
|
- cargo build
|
|
- cargo build --features "debugger"
|
|
- cargo test --verbose
|
|
|
|
# Set any required environment variables here
|
|
variables:
|
|
RUST_BACKTRACE: "FULL"
|
|
|
|
# Do any pre-flight requirements here, such as updating $PATH installing dependencies
|
|
before_script:
|
|
- export PATH="/root/.cargo/bin:$PATH"
|
|
|
|
# The following test: stages inherit from the test template above and
|
|
# configure the image used for the various Rust release trains
|
|
test:stable:
|
|
image: "rustdocker/rust:stable"
|
|
<<: *cargo_test
|
|
|
|
test:beta:
|
|
image: "rustdocker/rust:beta"
|
|
<<: *cargo_test
|
|
|
|
test:nightly:
|
|
image: "rustdocker/rust:nightly"
|
|
allow_failure: true
|
|
<<: *cargo_test
|
|
|
|
# Always want to run rustfmt and clippy against our tests, to ensure that
|
|
# we aren't using any anti-patterns or failing to follow our style guide
|
|
lint:rustfmt:
|
|
image: "guangie88/rustfmt-clippy"
|
|
script:
|
|
- cargo fmt -- --check
|
|
|
|
lint:clippy:
|
|
image: "guangie88/rustfmt-clippy"
|
|
allow_failure: false
|
|
script:
|
|
- cargo clippy -- -D warnings # Turn all warnings into errors
|