@@ -9,7 +9,7 @@ version: 2
9
9
keys :
10
10
# Find a cache corresponding to this specific target and Cargo.lock checksum.
11
11
# There are two dashes used between job and checksum to avoid x86_64 using the x86_64-musl cache
12
- - v3 -cargo-{{ .Environment.CIRCLE_JOB }}--{{ checksum "Cargo.lock" }}
12
+ - v4 -cargo-{{ .Environment.CIRCLE_JOB }}--{{ checksum "Cargo.lock" }}
13
13
- run :
14
14
name : " Download Web"
15
15
command : |
@@ -52,7 +52,24 @@ version: 2
52
52
- run :
53
53
name : " Test"
54
54
command : |
55
- [[ "$CIRCLE_JOB" != "x86_64-musl" ]] || time cargo test --release --target $TARGET
55
+ if [[ "$CIRCLE_JOB" != "x86_64-musl" ]]; then
56
+ exit 0
57
+ fi
58
+
59
+ # These flags are used so the test results can be used for code coverage
60
+ export CARGO_INCREMENTAL=0
61
+ export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Zno-landing-pads"
62
+
63
+ time cargo test
64
+ - run :
65
+ name : " Upload Code Coverage"
66
+ command : |
67
+ if [[ "$CIRCLE_JOB" != "x86_64-musl" ]]; then
68
+ exit 0
69
+ fi
70
+
71
+ grcov target -t lcov --branch --ignore-not-existing --ignore-dir "/*" --ignore-dir "*build.rs" -o lcov.info
72
+ bash <(curl -s https://codecov.io/bash) -f lcov.info
56
73
- run :
57
74
name : " Build DEB"
58
75
command : |
@@ -61,7 +78,7 @@ version: 2
61
78
mv ../pihole-api*.deb .
62
79
[[ "$CIRCLE_JOB" != "arm" ]] || for file in pihole-api*.deb; do mv $file ${file//armhf/arm}; done
63
80
- run :
64
- name : " Upload"
81
+ name : " Upload Artifacts "
65
82
command : |
66
83
[[ -z "$FTL_SECRET" || "$CIRCLE_PR_NUMBER" != "" ]] && exit 0
67
84
DIR="${CIRCLE_TAG:-${CIRCLE_BRANCH}}"
@@ -89,7 +106,7 @@ version: 2
89
106
- debian/pihole-API.service
90
107
- rpm/pihole-api.spec
91
108
- save_cache :
92
- key : v3 -cargo-{{ .Environment.CIRCLE_JOB }}--{{ checksum "Cargo.lock" }}
109
+ key : v4 -cargo-{{ .Environment.CIRCLE_JOB }}--{{ checksum "Cargo.lock" }}
93
110
paths :
94
111
- target
95
112
- /root/.cargo
0 commit comments