Paul Campbell
03ae9153b4
All checks were successful
Rust / build (push) Successful in 1m19s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
63 lines
2 KiB
Makefile
63 lines
2 KiB
Makefile
install-hooks:
|
|
@echo "Installing git hooks"
|
|
cargo install cc-cli
|
|
git config core.hooksPath .git-hooks
|
|
|
|
validate-dev-branch:
|
|
git rebase -i origin/main -x 'cargo fmt --check'
|
|
git rebase -i origin/main -x 'cargo build'
|
|
git rebase -i origin/main -x 'cargo test'
|
|
git rebase -i origin/main -x 'cargo clippy'
|
|
|
|
start-ngrok:
|
|
#!/usr/bin/env bash
|
|
# Uses NGROK_DOMAIN env var if available
|
|
if test -z ${NGROK_DOMAIN} ; then
|
|
ngrok http 8080
|
|
else
|
|
ngrok http --domain=${NGROK_DOMAIN} 8080
|
|
fi
|
|
|
|
coverage-update:
|
|
cargo tarpaulin --lib --out html
|
|
echo "Now:\n\topen tarpaulin-report.html"
|
|
|
|
coverage crate test:
|
|
cargo tarpaulin -p {{crate}} --lib --out html -- {{test}}
|
|
# cargo tarpaulin --skip-clean -p {{crate}} --lib --out html -- {{test}}
|
|
|
|
grcov-coverage:
|
|
#!/usr/bin/env bash
|
|
set -e
|
|
# an alternate coverage report
|
|
rustup component add llvm-tools-preview
|
|
export RUSTFLAGS="-Cinstrument-coverage"
|
|
cargo build
|
|
export LLVM_PROFILE_FILE="git-next-%p-%m.profraw"
|
|
cargo test
|
|
echo "Building report..."
|
|
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
|
|
find . -name '*.profraw' -exec rm "{}" \;
|
|
echo "Now:\n\topen target/debug/coverage/index.html"
|
|
|
|
publish version:
|
|
#!/usr/bin/bash -e
|
|
echo "Publishing git-next v{{version}} to crates.io..."
|
|
if [ -z $(git status --short) ]; then
|
|
echo "Worktree is clean - proceeding"
|
|
else
|
|
echo "Worktree is Dirty - aborting" ; exit
|
|
fi
|
|
git checkout v{{version}}
|
|
ORDER=$(cargo publish-workspace --target-version {{version}} --crate-prefix git-next --show-order 2>/dev/null | cut -d\ -f2-)
|
|
echo "Publishing crates in order: ${ORDER}"
|
|
# INFO: Why not use publish-workspace to publish? It doesn't support when crates-io registry is replaced
|
|
for P in ${ORDER}
|
|
do
|
|
echo "Publishing ${P}..."
|
|
cargo publish --registry crates-io -p $P
|
|
echo "Done: ${P}"
|
|
echo "======================================"
|
|
done
|
|
echo "All crates published"
|
|
git checkout dev
|