-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Justfile
33 lines (28 loc) · 1.07 KB
/
Justfile
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
set dotenv-load := true
_default:
@just --list --unsorted
# run unit and integration tests
test:
cargo test
cargo test --all-features --test integration -- --test-threads 1
# run integration tests with coverage
coverage:
cargo install cargo-llvm-cov
rustup component add llvm-tools-preview
cargo llvm-cov --remap-path-prefix --html --all-features -- --test-threads 1
cargo llvm-cov --remap-path-prefix --no-run --json --summary-only | \
jq -c '.data[0].totals.lines.percent | { \
schemaVersion: 1, \
label: "coverage", \
message: "\(.|round)%", \
color: (if . < 70 then "red" elif . < 80 then "yellow" else "green" end) \
}' > target/llvm-cov/html/coverage.json
# upload coverage to GitHub Pages
upload-coverage: coverage
git checkout gh-pages
rm -rf coverage coverage.json index.html style.css
cp -R target/llvm-cov/html/ .
git add -A coverage coverage.json index.html style.css
git commit -m "Coverage for $(git rev-parse --short main)"
git push
git checkout main