refactor: check scripts for justfile

chore: ci run examples
This commit is contained in:
thesimplekid
2024-08-19 01:02:45 +02:00
parent 9eff00bcaf
commit 65163b89bc
15 changed files with 93 additions and 171 deletions

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Check bindings
buildargs=(
"-p cdk-js --target wasm32-unknown-unknown"
)
for arg in "${buildargs[@]}"; do
echo "Checking '$arg'"
cargo build $arg
if [[ $arg != *"--target wasm32-unknown-unknown"* ]];
then
cargo test $arg
fi
cargo clippy $arg -- -D warnings
echo
done

View File

@@ -1,57 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# MSRV
msrv="1.70.0"
is_msrv=false
version=""
# Check if "msrv" is passed as an argument
if [[ "$#" -gt 0 && "$1" == "msrv" ]]; then
is_msrv=true
version="+$msrv"
fi
# Check if MSRV
if [ "$is_msrv" == true ]; then
# Install MSRV
rustup install $msrv
rustup component add clippy --toolchain $msrv
rustup target add wasm32-unknown-unknown --toolchain $msrv
fi
buildargs=(
"-p cdk-integration-tests"
"-p cdk"
"-p cdk --no-default-features"
"-p cdk --no-default-features --features wallet"
"-p cdk --no-default-features --features mint"
"-p cdk-redb"
"-p cdk-redb --no-default-features --features wallet"
"-p cdk-redb --no-default-features --features mint"
"-p cdk-sqlite --no-default-features --features mint"
"-p cdk-sqlite --no-default-features --features wallet"
"-p cdk-cln"
"-p cdk-axum"
"-p cdk-fake-wallet"
"-p cdk-strike"
"--bin cdk-cli"
"--bin cdk-mintd"
"--examples"
)
for arg in "${buildargs[@]}"; do
if [[ $version == "" ]]; then
echo "Checking '$arg' [default]"
else
echo "Checking '$arg' [$version]"
fi
cargo $version check $arg
if [[ $arg != *"--target wasm32-unknown-unknown"* ]]; then
cargo $version test $arg
fi
cargo $version clippy $arg -- -D warnings
echo
done

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
buildargs=(
"-p cdk"
)
for arg in "${buildargs[@]}"; do
echo "Checking '$arg' docs"
cargo doc $arg --all-features
echo
done

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
flags=""
# Check if "check" is passed as an argument
if [[ "$#" -gt 0 && "$1" == "check" ]]; then
flags="--check"
fi
# Check workspace crates
cargo fmt --all -- --config format_code_in_doc_comments=true $flags

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -exuo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
"${DIR}/check-fmt.sh" check # Check if Rust code is formatted
"${DIR}/check-crates.sh" # Check all crates
"${DIR}/check-crates.sh" msrv # Check all crates MSRV
"${DIR}/check-bindings.sh" # Check all bindings
"${DIR}/check-docs.sh" # Check Rust docs

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -exuo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
typos
"${DIR}/check-fmt.sh" # Format the code
"${DIR}/check-crates.sh" # Check all crates
"${DIR}/check-bindings.sh" # Check all bindings
"${DIR}/check-docs.sh" # Check Rust docs

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
args=(
"-p cdk"
"-p cdk-redb"
"-p cdk-sqlite"
"-p cdk-rexie"
"-p cdk-cln"
"-p cdk-fake-wallet"
"-p cdk-strike"
"-p cdk-cli"
"-p cdk-axum"
"-p cdk-mintd"
)
for arg in "${args[@]}";
do
echo "Publishing '$arg'"
cargo publish "$arg"
echo
done