Commit 89763392 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

gitlab-ci: add tarpaulin for coverage

parent 2a04b2d6
......@@ -37,6 +37,18 @@ before_script:
.cargo_test: &cargo_test
- cargo test --frozen --all --verbose
.cargo_tarpaulin_build: &cargo_tarpaulin_build
- .gitlab/ci/sccache.sh && export RUSTC_WRAPPER=$PWD/.gitlab/sccache
- .gitlab/ci/tarpaulin.sh
- export PATH=$PWD/.gitlab:$PATH
- cargo tarpaulin --no-run --frozen --exclude-files vendor --ignore-panics --all --verbose
- ".gitlab/sccache --show-stats || :"
.cargo_tarpaulin_test: &cargo_tarpaulin_test
- .gitlab/ci/tarpaulin.sh
- export PATH=$PWD/.gitlab:$PATH
- cargo tarpaulin --frozen --exclude-files vendor --ignore-panics --all --verbose
.rust_minimum: &rust_minimum
image: "rust:1.36.0"
......@@ -118,6 +130,36 @@ before_script:
script: *cargo_test
interruptible: true
.cargo_tarpaulin_build_job: &cargo_tarpaulin_build_job
stage: build
only: *only_settings
tags:
- build
- docker
- ghostflow
- linux
script: *cargo_tarpaulin_build
artifacts:
expire_in: 60m
paths:
- vendor
- .cargo
- Cargo.lock
- target
interruptible: true
.cargo_tarpaulin_test_job: &cargo_tarpaulin_test_job
stage: test
only: *only_settings
tags:
- docker
- ghostflow
- linux
- privileged
script: *cargo_tarpaulin_test
coverage: '/\d+.\d+% coverage, \d+\/\d+ lines covered/'
interruptible: true
stages:
- prepare
- build
......@@ -178,6 +220,21 @@ test:cargo-stable:
needs:
- build:cargo-stable
build:cargo-tarpaulin:
<<:
- *cargo_tarpaulin_build_job
- *rust_stable
- *cargo_cache_newest
test:cargo-tarpaulin:
<<:
- *cargo_tarpaulin_test_job
- *rust_stable
dependencies:
- build:cargo-tarpaulin
needs:
- build:cargo-tarpaulin
build:cargo-nightly:
<<:
- *cargo_build_job
......
#!/bin/sh
set -e
readonly version="0.10.0"
readonly sha256sum="6843be8384bf14385b36a3118efc1ed2d25d531acb8df954cd3f93d44018b09e"
readonly filename="cargo-tarpaulin-$version-travis"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > tarpaulin.sha256sum
curl -OL "https://github.com/xd009642/tarpaulin/releases/download/$version/$tarball"
sha256sum --check tarpaulin.sha256sum
tar xf "$tarball"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment