Commit 9133ffaa authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'add-gitlab-ci'

e987642c gitlab-ci: allow warnings from clippy (for now)
cd7d48d8

 gitlab-ci: add initial CI configuration
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !166
parents 8cb83034 e987642c
# The `mindeps` builds are not working due, at the root, `syntex` -> `ctest` ->
# `flate2` -> `reqwest`.
before_script:
- apt-get update -yqq
- export CARGO_HOME=.cargo-cache
- rustc --version
- cargo --version
.rust_tags: &rust_tags
- rust
- docker
- ghostflow
- linux
.cargo_update: &cargo_update
- cargo generate-lockfile $GENERATE_LOCKFILE_ARGS
- cargo fetch --locked
.cargo_build: &cargo_build
- cargo build $CARGO_BUILD_FROZEN --all --verbose
- cargo test --frozen --all --no-run --verbose
.cargo_test: &cargo_test
- cargo test --frozen --all --verbose
.rust_minimum: &rust_minimum
image: "rust:1.34.2"
variables:
# Not supported yet here? If updating to a version where this works,
# remove this variable.
#CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
.rust_stable: &rust_stable
image: "rust:latest"
variables:
CARGO_BUILD_FROZEN: --frozen
CARGO_UPDATE_POLICY: newest
.rust_nightly: &rust_nightly
extends: .rust_stable
image: "rustlang/rust:nightly"
.cargo_fetch_job: &cargo_fetch_job
stage: prepare
tags: *rust_tags
script: *cargo_update
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- Cargo.lock
cache:
key: cargo-cache-$CARGO_UPDATE_POLICY
paths:
- .cargo-cache
interruptible: true
.cargo_build_job: &cargo_build_job
stage: build
tags: *rust_tags
script: *cargo_build
artifacts:
expire_in: 60m
paths:
- .cargo-cache
- Cargo.lock
- target
cache:
key: build-cache-$CI_JOB_NAME
paths:
- target
interruptible: true
.cargo_test_job: &cargo_test_job
stage: test
tags: *rust_tags
script: *cargo_test
interruptible: true
stages:
- prepare
- build
- test
prepare:cargo-cache-newest:
<<:
- *cargo_fetch_job
- *rust_stable
.cargo_cache_newest: &cargo_cache_newest
dependencies:
- prepare:cargo-cache-newest
needs:
- prepare:cargo-cache-newest
build:cargo-clippy:
<<:
- *cargo_build_job
- *rust_stable
- *cargo_cache_newest
script:
- rustup component add clippy
#- cargo clippy --frozen --tests --all --verbose -- -D warnings
- cargo clippy --frozen --tests --all --verbose
build:cargo-minimum:
<<:
- *cargo_build_job
- *rust_minimum
- *cargo_cache_newest
test:cargo-minimum:
<<:
- *cargo_test_job
- *rust_minimum
dependencies:
- build:cargo-minimum
needs:
- build:cargo-minimum
build:cargo-stable:
<<:
- *cargo_build_job
- *rust_stable
- *cargo_cache_newest
test:cargo-stable:
<<:
- *cargo_test_job
- *rust_stable
dependencies:
- build:cargo-stable
needs:
- build:cargo-stable
build:cargo-nightly:
<<:
- *cargo_build_job
- *rust_nightly
- *cargo_cache_newest
test:cargo-nightly:
<<:
- *cargo_test_job
- *rust_nightly
dependencies:
- build:cargo-nightly
needs:
- build:cargo-nightly
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment