Skip to content

Commit

Permalink
fix: speed up precommit builds (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
miraleung committed Sep 10, 2020
1 parent 258706a commit 76d61a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fi
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
then
echo_status "Running Java linter..."
bazel build --disk_cache="$BAZEL_CACHE_DIR" //:google_java_format_verification
bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //:google_java_format_verification
FORMAT_STATUS=$?
if [ $FORMAT_STATUS != 0 ]
then
Expand All @@ -100,7 +100,7 @@ fi
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_BAZEL_FILES_CHANGED -gt 0 ]
then
echo_status "Checking the build..."
bazel build --disk_cache="$BAZEL_CACHE_DIR" //...
bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //...
BUILD_STATUS=$?
if [ $BUILD_STATUS != 0 ]
then
Expand All @@ -112,7 +112,7 @@ fi
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ]
then
echo_status "Checking tests..."
bazel test --disk_cache="$BAZEL_CACHE_DIR" //...
bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //...
TEST_STATUS=$?
if [ $TEST_STATUS != 0 ]
then
Expand Down

0 comments on commit 76d61a0

Please sign in to comment.