fif/.gitlab-ci.yml

113 lines
1.7 KiB
YAML

image: "rust:latest"
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
cache:
paths:
- target
- .cargo
default:
before_script:
- rustc --version
- cargo version
stages:
- lint
- build
- version
- test
# TEMPLATE
.cargo-build:
stage: build
parallel:
matrix:
- FEATURES:
- xdg-mime-backend
- infer-backend
- multi-threaded xdg-mime-backend
- multi-threaded infer-backend
only:
refs:
- branches
- tags
changes:
- "/src/**/*"
- .gitlab-ci.yml
script:
cargo build --no-default-features --locked --features="json $FEATURES"
.cargo-test:
extends: .cargo-build
stage: test
script:
cargo test --no-default-features --locked --verbose --features="json $FEATURES"
clippy:
stage: lint
script:
- rustup component add clippy
- cargo clippy --version
- ./clippy.sh ci
# BUILD
build-stable:
extends: .cargo-build
build-msrv:
extends: build-stable
image: "rust:1.43.0"
cache:
key: msrv
paths:
- target
- .cargo
build-nightly:
extends: build-stable
image: "rustlang/rust:nightly"
cache:
key: nightly
paths:
- target
- .cargo
# VERSION
fif-version:
stage: version
needs: ["build-stable"]
script:
cargo run -- -V
# TEST
test-stable:
extends: .cargo-test
needs: ["build-stable"]
test-msrv:
extends: test-stable
image: "rust:1.43.0"
needs: ["build-msrv"]
cache:
key: msrv
paths:
- target
- .cargo
test-nightly:
extends: test-stable
image: "rustlang/rust:nightly"
needs: ["build-nightly"]
cache:
key: nightly
paths:
- target
- .cargo