You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
obws/Justfile

34 lines
1.1 KiB
Plaintext

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