Skip to content

Commit

Permalink
update diff-check logging
Browse files Browse the repository at this point in the history
These changes mostly improve logging out the cargo version and version
of the two rustfmt binaries that are compiled. Some other minor logging
changes were made as well to add some whitespace to improve visual
clarity when looking at the logs in the GitHub Actions console.
  • Loading branch information
ytmimi authored and calebcartwright committed Nov 2, 2023
1 parent 8d2c415 commit b446e8e
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ci/check_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,28 @@ function compile_rustfmt() {
git remote add feature $REMOTE_REPO
git fetch feature $FEATURE_BRANCH

cargo build --release --bin rustfmt && cp target/release/rustfmt $1/rustfmt
CARGO_VERSON=$(cargo --version)
echo -e "\ncompiling with $CARGO_VERSON\n"

echo "Building rustfmt from src"
cargo build -q --release --bin rustfmt && cp target/release/rustfmt $1/rustfmt

if [ -z "$OPTIONAL_COMMIT_HASH" ] || [ "$FEATURE_BRANCH" = "$OPTIONAL_COMMIT_HASH" ]; then
git switch $FEATURE_BRANCH
else
git switch $OPTIONAL_COMMIT_HASH --detach
fi
cargo build --release --bin rustfmt && cp target/release/rustfmt $1/feature_rustfmt

echo "Building feature rustfmt from src"
cargo build -q --release --bin rustfmt && cp target/release/rustfmt $1/feature_rustfmt

RUSFMT_BIN=$1/rustfmt
RUSTFMT_VERSION=$($RUSFMT_BIN --version)
echo -e "\nRUSFMT_BIN $RUSTFMT_VERSION\n"

FEATURE_BIN=$1/feature_rustfmt
FEATURE_VERSION=$($FEATURE_BIN --version)
echo -e "FEATURE_BIN $FEATURE_VERSION\n"
}

# Check the diff for running rustfmt and the feature branch on all the .rs files in the repo.
Expand Down Expand Up @@ -155,7 +168,7 @@ function check_repo() {
STATUSES+=($?)
set -e

echo "removing tmp_dir $tmp_dir"
echo -e "removing tmp_dir $tmp_dir\n\n"
rm -rf $tmp_dir
cd $WORKDIR
}
Expand Down

0 comments on commit b446e8e

Please sign in to comment.