mirror of
https://github.com/dnaka91/obws
synced 2024-11-13 19:12:03 +00:00
34 lines
1.1 KiB
Makefile
34 lines
1.1 KiB
Makefile
set dotenv-load := true
|
|
|
|
nightly := "nightly-2021-11-18"
|
|
|
|
_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 grcov
|
|
rustup toolchain install {{nightly}} --component llvm-tools-preview
|
|
|
|
rm -rf *.profraw ./target/debug/coverage
|
|
|
|
RUSTFLAGS="-Zinstrument-coverage -Clink-dead-code" LLVM_PROFILE_FILE="coverage-%p-%m.profraw" cargo +{{nightly}} test --all-features -- --test-threads 1
|
|
rustup run {{nightly}} grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage --ignore 'examples/**' --ignore 'tests/**'
|
|
|
|
rm -f *.profraw
|
|
|
|
# upload coverage to GitHub Pages
|
|
upload-coverage: coverage
|
|
git checkout gh-pages
|
|
rm -rf badges examples src tests coverage.json index.html
|
|
cp -R target/debug/coverage/ .
|
|
git add -A badges examples src tests coverage.json index.html
|
|
git commit -m "Coverage for $(git rev-parse --short main)"
|
|
git push
|
|
git checkout main
|