3333 # that the file is not tracked by bazel (e.g. documentation, tools)
3434 # and can be ignored.
3535 mapfile -O ${# files[@]} -t files <<< \
36- "$( bazel query $file 2> /dev/null| sed s/:BUILD/:all/) "
36+ "$( bazel query $file 2> /dev/null | sed s/:BUILD/:all/) "
3737 bazel query $file 2>/dev/null
3838 done
3939fi
4040
41- if [[ -z "${files[*] } " ]]; then
42- echo "No buildable files affected. "
41+ if [[ -z "${files} " ]]; then
42+ echo "(no buildable files affected) "
4343 exit 0
4444fi
4545
@@ -49,10 +49,11 @@ trap "exit_code=1" ERR
4949# We can't use --noshow_progress on build/test commands because Travis
5050# terminates the build after 10 mins without output.
5151buildables=$( bazel query -k --noshow_progress \
52- " kind(rule, rdeps(//..., set(${files[*]} )))" \
52+ " kind(rule, rdeps(//..., set(${files[*]} )))" 2> /dev/null \
5353 | grep -v :_)
5454if [[ ! -z $buildables ]]; then
55- echo "Building targets"
55+ echo ""
56+ echo "Building targets:"
5657 echo "$buildables "
5758 bazel build --experimental_ui_actions_shown=1 -k $buildables
5859fi
6263tests=$( bazel query -k --noshow_progress \
6364 " kind(test, rdeps(//..., set(${files[*]} ))) \
6465 except attr('tags', 'noci', //...) \
65- except attr('tags', 'manual', //...)" \
66+ except attr('tags', 'manual', //...)" 2> /dev/null \
6667 | grep -v :_)
6768if [[ ! -z $tests ]]; then
68- echo "Running tests"
69+ echo ""
70+ echo "Running tests:"
6971 echo "$tests "
7072 bazel test --experimental_ui_actions_shown=1 -k $tests
7173fi
0 commit comments