2021-04-21 07:06:56 +00:00
|
|
|
image: "rust:latest"
|
|
|
|
|
2021-04-26 10:34:17 +00:00
|
|
|
variables:
|
|
|
|
CARGO_HOME: $CI_PROJECT_DIR/.cargo
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- target
|
|
|
|
- .cargo
|
|
|
|
|
2021-04-21 07:06:56 +00:00
|
|
|
default:
|
|
|
|
before_script:
|
2021-04-28 06:09:11 +00:00
|
|
|
- rustc --version
|
|
|
|
- cargo version
|
2021-04-21 07:06:56 +00:00
|
|
|
|
2021-04-21 06:57:57 +00:00
|
|
|
stages:
|
2021-04-28 06:09:11 +00:00
|
|
|
- lint
|
2021-04-21 06:57:57 +00:00
|
|
|
- build
|
2021-04-21 07:06:56 +00:00
|
|
|
- test
|
2021-04-28 06:09:11 +00:00
|
|
|
- version
|
2021-04-21 06:57:57 +00:00
|
|
|
|
2021-04-28 10:14:52 +00:00
|
|
|
# TEMPLATE
|
|
|
|
.cargo-build:
|
|
|
|
stage: build
|
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- FEATURES: [ 'xdg-mime-backend', 'infer-backend', 'multi-threaded xdg-mime-backend',
|
|
|
|
'multi-threaded infer-backend' ]
|
|
|
|
script:
|
|
|
|
cargo build --no-default-features --locked --features="$FEATURES"
|
|
|
|
|
|
|
|
.cargo-test:
|
|
|
|
stage: test
|
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- FEATURES: [ 'xdg-mime-backend', 'infer-backend', 'multi-threaded xdg-mime-backend',
|
|
|
|
'multi-threaded infer-backend' ]
|
|
|
|
script:
|
|
|
|
cargo test --no-default-features --locked --verbose --features="$FEATURES"
|
|
|
|
|
2021-04-28 06:09:11 +00:00
|
|
|
clippy:
|
|
|
|
stage: lint
|
|
|
|
script:
|
|
|
|
- rustup component add clippy
|
|
|
|
- cargo clippy --version
|
|
|
|
- ./clippy.sh ci
|
|
|
|
|
2021-04-28 10:14:52 +00:00
|
|
|
# BUILD
|
2021-04-21 07:06:56 +00:00
|
|
|
|
2021-04-28 10:14:52 +00:00
|
|
|
build-stable:
|
|
|
|
extends: .cargo-build
|
2021-04-28 06:09:11 +00:00
|
|
|
|
2021-04-28 10:14:52 +00:00
|
|
|
build-msrv:
|
|
|
|
extends: build-stable
|
|
|
|
image: "rust:1.43.0"
|
2021-04-21 07:06:56 +00:00
|
|
|
|
2021-04-28 10:14:52 +00:00
|
|
|
build-nightly:
|
|
|
|
extends: build-stable
|
|
|
|
image: "rustlang/rust:nightly"
|
|
|
|
|
|
|
|
# TEST
|
|
|
|
|
|
|
|
test-stable:
|
|
|
|
extends: .cargo-test
|
2021-04-28 10:34:46 +00:00
|
|
|
needs: ["build-stable"]
|
2021-04-28 10:14:52 +00:00
|
|
|
|
|
|
|
test-msrv:
|
|
|
|
extends: test-stable
|
|
|
|
image: "rust:1.43.0"
|
2021-04-28 10:34:46 +00:00
|
|
|
needs: ["build-msrv"]
|
2021-04-28 10:14:52 +00:00
|
|
|
|
|
|
|
test-nightly:
|
|
|
|
extends: test-stable
|
|
|
|
image: "rustlang/rust:nightly"
|
2021-04-28 10:34:46 +00:00
|
|
|
needs: ["build-nightly"]
|
2021-04-28 10:14:52 +00:00
|
|
|
|
|
|
|
# VERSION
|
2021-04-28 06:09:11 +00:00
|
|
|
|
|
|
|
fif-version:
|
|
|
|
stage: version
|
2021-04-28 10:34:46 +00:00
|
|
|
needs: ["build-stable"]
|
2021-04-28 06:09:11 +00:00
|
|
|
script:
|
|
|
|
cargo run -- -V
|