Skip to content

Commit 002fb11

Browse files
authored
Merge pull request #503 from tock/github-ci-grouping
ci: group output of builds separately
2 parents b9ccccf + 68ed255 commit 002fb11

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

examples/build_all.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ declare -a failures
3838

3939
function opt_rebuild {
4040
if [ "${CI-}" == "true" ]; then
41+
echo "::group::Verbose Rebuild for $1"
4142
echo "${bold}Rebuilding Verbose: $1${normal}"
4243
make CFLAGS=-Werror V=1
44+
echo "::endgroup::"
4345
fi
4446
}
4547

@@ -49,11 +51,20 @@ for mkfile in `find . -maxdepth 6 -name Makefile`; do
4951
# Skip directories with leading _'s, useful for leaving test apps around
5052
if [[ $(basename $dir) == _* ]]; then continue; fi
5153

54+
# If running under CI, give a hint to the UX to show each app build independently
55+
if [ "${CI-}" == "true" ]; then
56+
echo "::group::Build for $dir"
57+
fi
58+
5259
pushd $dir > /dev/null
5360
echo ""
5461
echo "Building $dir"
5562
make CFLAGS=-Werror -j $NUM_JOBS || { echo "${bold} ⤤ Failure building $dir${normal}" ; opt_rebuild $dir; failures+=("$dir"); }
5663
popd > /dev/null
64+
65+
if [ "${CI-}" == "true" ]; then
66+
echo "::endgroup::"
67+
fi
5768
done
5869

5970
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u

examples/format_all.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ export TOCK_NO_CHECK_UNSTAGED=1
1111

1212
function opt_rebuild {
1313
if [ "$CI" == "true" ]; then
14+
echo "::group::Verbose Rebuild for $1"
1415
echo "${bold}Rebuilding Verbose: $1${normal}"
1516
make format V=1
17+
echo "::endgroup::"
1618
fi
1719
}
1820

@@ -25,11 +27,19 @@ for mkfile in `find . -maxdepth 5 -name Makefile`; do
2527
# Skip directories with leading _'s, useful for leaving test apps around
2628
if [[ $(basename $dir) == _* ]]; then continue; fi
2729

30+
if [ "${CI-}" == "true" ]; then
31+
echo "::group::Build for $dir"
32+
fi
33+
2834
pushd $dir > /dev/null
2935
echo ""
3036
echo "Formatting $dir"
3137
make format || (echo "${bold} ⤤ Failure formatting $dir${normal}" ; opt_rebuild $dir; exit 1)
3238
popd > /dev/null
39+
40+
if [ "${CI-}" == "true" ]; then
41+
echo "::endgroup::"
42+
fi
3343
done
3444

3545
echo ""

0 commit comments

Comments
 (0)