From 0b01e9643789093f496cac816f7b33c6692eb7be Mon Sep 17 00:00:00 2001 From: Kai Kriegel Date: Wed, 16 Sep 2020 10:41:05 +0000 Subject: [PATCH] Fancy CI --- .gitlab-ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ .gitmodules | 2 +- schema | 2 +- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..72aa360 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,53 @@ +# 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 + +# 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? + +# Use cargo to test the project +test:cargo: + script: + - rustc --version && cargo --version # Print version info for debugging + - cargo test --workspace --verbose + + +# cache dependencies and build environment to speed up setup +cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - apt/ + # - cargo/ + - target/ diff --git a/.gitmodules b/.gitmodules index ea4bf1b..f635006 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "schema"] path = schema - url = ./schema + url = ../../fabaccess-api.git diff --git a/schema b/schema index d542e94..5b7a31b 160000 --- a/schema +++ b/schema @@ -1 +1 @@ -Subproject commit d542e947e8300884b86aba4773f29b86c150d71c +Subproject commit 5b7a31b00528d535b8858289d1db685269ec9b7b