stages:
- cargotest
- junit
- release
- sast
- renovate
image: rust:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- apt-get update -yqq;
- apt-get install -yqq --no-install-recommends build-essential clang git
test:cargo:
stage: cargotest
script:
- rustup default nightly
- rustc --version && cargo --version
- cargo test --verbose
test:junit-report:
stage: junit
script:
- rustup default nightly
- cargo install junitify
- cargo test -- --format=json -Z unstable-options --report-time | junitify --out
$CI_PROJECT_DIR/tests/
artifacts:
when: always
reports:
junit: "$CI_PROJECT_DIR/tests/*.xml"
sast:
stage: sast
include:
- template: Security/SAST.gitlab-ci.yml
cov:
stage: sast
variables:
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
script:
- cargo install grcov
- cargo build --workspace
- cargo test --workspace
- mkdir target/coverage
- |
grcov \
target/coverage \
--binary-path target/debug \
-s . \
-o target/coverage \
--keep-only 'src/*' \
--output-types html,cobertura
coverage: '/Coverage: \d+(?:\.\d+)?/'
artifacts:
paths:
- target/coverage/
reports:
coverage_report:
coverage_format: cobertura
path: target/coverage.xml
allow_failure: true