Skip to content

Commit 013e63f

Browse files
committed
more CI logging improvements
1 parent 540dbae commit 013e63f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/runtests.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ fi
1313
fail_count=0
1414
pass_count=0
1515

16+
inCIEnvironment () [[ ! -z "${CI:-}" ]]
17+
1618
echo "Compiling serve-d in release mode with ${DC}..."
1719

20+
inCIEnvironment && echo "::group::Building serve-d"
1821
pushd ..
1922
if [ "$DC" = "dmd" ]; then
2023
echo "(Debug build because using DMD)"
@@ -23,6 +26,7 @@ else
2326
dub build --build=release --compiler="${DC}"
2427
fi
2528
popd
29+
inCIEnvironment && echo "::endgroup::"
2630

2731
tests="${@:1}"
2832
if [ -z "$tests" ]; then
@@ -33,8 +37,9 @@ echo "Running tests with ${DC}..."
3337

3438
for testCase in $tests; do
3539
# GitHub Actions grouping
36-
echo "::group::$testCase"
3740
echo -e "${YELLOW}$testCase${NORMAL}"
41+
42+
inCIEnvironment && echo "::group::$testCase"
3843
pushd $testCase
3944

4045
if [ -f .needs_dcd ]; then
@@ -46,22 +51,24 @@ for testCase in $tests; do
4651
fi
4752

4853
dub upgrade 2>&1
54+
4955
dub --compiler="${DC}" 2>&1
5056
if [[ $? -eq 0 ]]; then
57+
inCIEnvironment && echo "::endgroup::"
5158
echo -e "${YELLOW}$testCase:${NORMAL} ... ${GREEN}Test Pass${NORMAL}";
5259
let pass_count=pass_count+1
5360
else
61+
inCIEnvironment && echo "::endgroup::"
5462
echo -e "${YELLOW}$testCase:${NORMAL} ... ${RED}Test Fail${NORMAL}";
5563
let fail_count=fail_count+1
5664
fi
5765

5866
popd
59-
echo "::endgroup::"
6067
done
6168

6269
if [[ $fail_count -eq 0 ]]; then
6370
echo -e "${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
6471
else
6572
echo -e "${RED}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
6673
exit 1
67-
fi
74+
fi

0 commit comments

Comments
 (0)