fabaccess-bffh/.gitlab-ci.yml

75 lines
1.8 KiB
YAML
Raw Normal View History

2020-09-16 12:41:05 +02:00
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
image: "rust:latest"
# Optional: Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
# services:
# - mysql:latest
# - redis:latest
# - postgres:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
# CARGO_HOME: $CI_PROJECT_DIR/cargo
APT_CACHE_DIR: $CI_PROJECT_DIR/apt
# install build dependencies
before_script:
- apt-get update -yqq
- apt-get install -o dir::cache::archives="$APT_CACHE_DIR" -yqq --no-install-recommends capnproto build-essential cmake clang libclang-dev libgsasl7-dev
- rustup update
- rustup component add rustfmt
- rustup component add clippy
# Use clippy to lint the project
lint:clippy:
allow_failure: true
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo clippy -- -D warnings
only:
- master
- development
- merge_requests
2020-09-17 15:07:04 +02:00
tags:
- linux
- docker
2020-09-16 12:41:05 +02:00
# Use rustfmt to check formating of the project
lint:fmt:
allow_failure: true
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo fmt -- --check # TODO: Do we want to enforce formating?
only:
- master
- development
- merge_requests
2020-09-17 15:07:04 +02:00
tags:
- linux
- docker
2020-09-16 12:41:05 +02:00
# Use cargo to test the project
test:cargo:
script:
- rustc --version && cargo --version # Print version info for debugging
- cargo test --workspace --verbose
only:
- master
- development
- merge_requests
2020-09-17 15:07:04 +02:00
tags:
- linux
- docker
2020-09-16 12:41:05 +02:00
# cache dependencies and build environment to speed up setup
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- apt/
# - cargo/
- target/