Skip to content

Commit

Permalink
Final refactor fo run_all.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Oct 16, 2023
1 parent 766395c commit 1744cbb
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions rust_dev_preview/run_all.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"

DIRS=(
cross_service
examples
lambda
webassembly
)

ACTIONS=(
"fmt --check"
clippy
test
)

# Clean Cargo.log
rm rust_dev_preview/**/Cargo.lock
rm **/Cargo.lock

export RUSTFLAGS="-D warnings" ;
export APP_ENVIRONMENT="test"

CARGO="$HOME/.cargo/bin/cargo"

FAIL=()
for f in ${DIRS[@]} ; do
"$HOME/.cargo/bin/cargo" fmt --manifest-path rust_dev_preview/$f/Cargo.toml --all --check || FAIL+=("fmt:$f")
"$HOME/.cargo/bin/cargo" clippy --manifest-path rust_dev_preview/$f/Cargo.toml --all || FAIL+=("clippy:$f")
"$HOME/.cargo/bin/cargo" test --manifest-path rust_dev_preview/$f/Cargo.toml --all || FAIL+=("test:$f")
for f in "${DIRS[@]}" ; do
for a in "${ACTIONS[@]}" ; do
"$CARGO" $a --manifest-path $f/Cargo.toml --all || FAIL+=("${a}:$f")
done
done

echo $FAIL;
exit "${#FAIL[@]}"
echo ${FAIL[@]}
exit ${#FAIL[@]}

0 comments on commit 1744cbb

Please sign in to comment.