-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
79 lines (73 loc) · 1.8 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
stages:
- test
- cover
- publish
.before_script: &cargo_home
- export CARGO_HOME="$PWD/cargo"
variables:
CRATE_NAME: unix_named_pipe
cargo tests amd64:
image: containers.dev.maio.me/sjohnson/containers/rust-gcc:latest
stage: test
tags:
- amd64
before_script: *cargo_home
script:
- cargo clean
- RUSTFLAGS='-C link-dead-code' cargo test
cache:
policy: push
paths:
- cargo
- target
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[-_ ]tests\]/i
kcov cover amd64:
image: containers.dev.maio.me/sjohnson/containers/kcov:latest
stage: cover
tags:
- amd64
dependencies:
- cargo tests amd64
before_script: *cargo_home
script:
- mkdir -p ./coverage/units ./coverage/doctest
- 'find ./target/debug -maxdepth 1 -regex .\*${CRATE_NAME}-\[\^.\]\*\$ | xargs -n1 /app/bin/kcov --exclude-pattern=${CARGO_HOME} ./coverage/doctest || true'
- 'find ./target/debug -maxdepth 1 -regex .\*_test-\[\^.\]\*\$ | xargs -n1 /app/bin/kcov --exclude-pattern=${CARGO_HOME} ./coverage/units || true'
- /app/bin/kcov --merge ./coverage ./coverage/units ./coverage/doctest
- cat ./coverage/kcov-merged/coverage.json | jq '.percent_covered'
coverage: '/"\d+\.\d+"/'
cache:
policy: pull
paths:
- cargo
- target
artifacts:
name: coverage
paths:
- coverage
pages:
image: containers.dev.maio.me/sjohnson/containers/rust-gcc:latest
stage: publish
tags:
- amd64
dependencies:
- kcov cover amd64
before_script: *cargo_home
script:
- cargo doc --target-dir . --no-deps --lib
- mv doc public
- mv coverage public/coverage
- cp -v ci/docs/index.html public/index.html
cache:
policy: pull
paths:
- cargo
- target
artifacts:
paths:
- public
only:
- master