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.
46 lines
1.0 KiB
Bash
46 lines
1.0 KiB
Bash
#! /bin/sh
|
|
|
|
die() {
|
|
printf "\e[31:1mError: %s\e[0m\n" "$1" >&2
|
|
exit 1
|
|
}
|
|
|
|
(
|
|
cd "$(git rev-parse --show-toplevel)" || die "cannot find project root"
|
|
|
|
# Badges!
|
|
mkdir -p ./target/shields
|
|
if cargo "+${RUST_CHAIN}" --color=always build --all-targets; then
|
|
cat <<EOF > "./target/shields/$RUST_CHAIN-build.json"
|
|
{
|
|
"color": "brightgreen",
|
|
"isError": true,
|
|
"label": "$RUST_CHAIN build",
|
|
"message": "passing",
|
|
"schemaVersion": 1
|
|
}
|
|
EOF
|
|
else
|
|
PRV_EXIT=$?
|
|
cat <<EOF > "./target/shields/$RUST_CHAIN-build.json"
|
|
{
|
|
"color": "red",
|
|
"isError": true,
|
|
"label": "$RUST_CHAIN build",
|
|
"message": "failed",
|
|
"schemaVersion": 1
|
|
}
|
|
EOF
|
|
exit $PRV_EXIT
|
|
fi
|
|
|
|
cargo "+${RUST_CHAIN}" --color=always test --no-fail-fast
|
|
exitcode=$?
|
|
|
|
# create badge for `cargo test`
|
|
cargo "+${RUST_CHAIN}" test --no-fail-fast -- -Z unstable-options --format json | \
|
|
jq -s -f ./scripts/shields-from-tests.jq > ./target/shields/cargo-test.json
|
|
|
|
exit $exitcode
|
|
)
|