stages:
- generate_test_data
- coverage_report
- upload_report
nightly:
image: "rustlang/rust:nightly"
stage: generate_test_data
script:
- env RUST_BACKTRACE=1 cargo test --all-features
only:
changes:
- Cargo.toml
- src/**/*
- tests/**/*
- benches/**/*
- examples/**/*
generate_test_data:
image: "rust:latest"
stage: generate_test_data
script:
- rustc --version && cargo --version - cargo check
- cargo test --no-run --all-features
artifacts:
paths:
- target/debug/deps/*-*
expire_in: 30 minutes
only:
changes:
- Cargo.toml
- src/**/*
- tests/**/*
- benches/**/*
- examples/**/*
coverage_report:
image:
name: "ragnaroek/kcov_head:latest"
entrypoint: [""]
stage: "coverage_report"
script:
- ls target/debug/deps/ || echo "notfound"
- for file in $(ls -1 target/debug/deps/ | grep "-" | grep -v "\.");
do
mkdir -p "target/cov/$(basename $file)";
env RUST_BACKTRACE=1 kcov --exclude-pattern=/.cargo,/usr/lib
--verify "target/cov/$(basename $file)"
"target/debug/deps/$file";
done
artifacts:
paths:
- target/cov/*
expire_in: 30 minutes
only:
changes:
- Cargo.toml
- src/**/*
- tests/**/*
upload_report:
image: "centos:latest"
stage: "upload_report"
script:
- bash <(curl -s https://codecov.io/bash) -Z
allow_failure : true
only:
changes:
- Cargo.toml
- src/**/*
- tests/**/*
compatibility_1_51:
image: "rust:1.51.0"
stage: generate_test_data
script:
- rustc --version && cargo --version - cargo test --no-run --all-features
only:
changes:
- Cargo.toml
- src/**/*
- tests/**/*
- benches/**/*
- examples/**/*