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
|
2020-09-17 15:01:55 +02:00
|
|
|
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?
|
2020-09-17 15:01:55 +02:00
|
|
|
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
|
2020-09-17 15:01:55 +02:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- development
|
|
|
|
- merge_requests
|
2020-09-17 15:07:04 +02:00
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
- docker
|
2020-09-16 12:41:05 +02:00
|
|
|
|
2020-10-06 14:43:40 +02:00
|
|
|
build:docker-master:
|
|
|
|
image:
|
2021-09-19 18:30:14 +02:00
|
|
|
name: gcr.io/kaniko-project/executor:v1.6.0-debug
|
2020-10-06 14:43:40 +02:00
|
|
|
entrypoint: [""]
|
2020-10-06 15:28:10 +02:00
|
|
|
before_script:
|
|
|
|
- ''
|
2020-10-06 14:43:40 +02:00
|
|
|
script:
|
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
2021-09-19 18:30:14 +02:00
|
|
|
- /kaniko/executor --force --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest
|
2020-10-06 14:43:40 +02:00
|
|
|
only:
|
|
|
|
- master
|
2020-10-06 15:23:09 +02:00
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
- docker
|
2020-10-06 14:43:40 +02:00
|
|
|
|
|
|
|
build:docker-releases:
|
|
|
|
image:
|
2021-09-19 18:30:14 +02:00
|
|
|
name: gcr.io/kaniko-project/executor:v1.6.0-debug
|
2020-10-06 14:43:40 +02:00
|
|
|
entrypoint: [""]
|
2020-10-06 15:28:10 +02:00
|
|
|
before_script:
|
|
|
|
- ''
|
2020-10-06 14:43:40 +02:00
|
|
|
script:
|
|
|
|
- mkdir -p /kaniko/.docker
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
2021-09-19 18:30:14 +02:00
|
|
|
- /kaniko/executor --force --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
2020-10-06 14:43:40 +02:00
|
|
|
only:
|
|
|
|
- tags
|
2020-10-06 15:23:09 +02:00
|
|
|
tags:
|
|
|
|
- linux
|
|
|
|
- docker
|
2020-10-06 14:43:40 +02:00
|
|
|
|
2021-12-14 15:28:08 +01:00
|
|
|
build:binary-development:
|
|
|
|
image: rust:latest
|
2021-12-14 00:57:14 +01:00
|
|
|
|
2021-12-14 02:16:49 +01:00
|
|
|
|
2021-12-14 13:35:38 +01:00
|
|
|
before_script:
|
2021-12-14 15:28:08 +01:00
|
|
|
- cat > /cargo/config << EOF
|
|
|
|
[target.armv7-unknown-linux-gnueabihf]
|
|
|
|
linker = "arm-linux-gnueabihf-gcc"
|
|
|
|
EOF
|
|
|
|
- dkpg --add-architecture armhf
|
|
|
|
- apt-get update -yqq
|
|
|
|
- apt-get install -y libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf
|
|
|
|
- apt-get install -yqq --no-install-recommends capnproto build-essential cmake clang libclang-dev libclang-dev:armhf libgsasl7-dev libgsasl7-dev:armhf
|
|
|
|
- rustup target add armv7-unknown-linux-armeabihf
|
|
|
|
|
2020-10-06 14:43:40 +02:00
|
|
|
script:
|
2021-12-14 15:28:08 +01:00
|
|
|
- cargo check --target x86_64-unknown-linux-gnu
|
|
|
|
- cargo check --target armv7-unknown-linux-gnueabihf
|
|
|
|
|
2021-12-14 00:57:14 +01:00
|
|
|
# only:
|
|
|
|
# - development
|
2020-10-06 15:23:09 +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/
|