variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 3
GIT_CLEAN_FLAGS: -f
CACHE_IMAGE_TAG: latest
stages:
- check-compile
- post
before_script:
- source $HOME/.cargo/env
- df -h /
- free -h
- cargo --version
- export DISABLE_GIT_LFS_CHECK=true
- export RUSTFLAGS="-D warnings"
- rm -r target || echo "target doesnt exist, which is fine"
code-quality:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
stage: check-compile
tags: ["check"]
script:
- cargo clippy --all-targets -- -D warnings
- cargo fmt --all -- --check
security:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
stage: check-compile
allow_failure: true
tags: ["check"]
script:
- cargo audit
unittests:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/quality:${CACHE_IMAGE_TAG}
stage: post
tags: ["check"]
script:
- cargo test
coverage:
image: registry.gitlab.com/veloren/veloren-docker-ci/cache/tarpaulin:${CACHE_IMAGE_TAG}
stage: post
tags: ["check"]
coverage: '/^\d+.\d+% coverage/'
script:
- cargo tarpaulin -v