13
13
fail_count=0
14
14
pass_count=0
15
15
16
+ inCIEnvironment () [[ ! -z " ${CI:- } " ]]
17
+
16
18
echo " Compiling serve-d in release mode with ${DC} ..."
17
19
20
+ inCIEnvironment && echo " ::group::Building serve-d"
18
21
pushd ..
19
22
if [ " $DC " = " dmd" ]; then
20
23
echo " (Debug build because using DMD)"
23
26
dub build --build=release --compiler=" ${DC} "
24
27
fi
25
28
popd
29
+ inCIEnvironment && echo " ::endgroup::"
26
30
27
31
tests=" ${@: 1} "
28
32
if [ -z " $tests " ]; then
@@ -33,8 +37,9 @@ echo "Running tests with ${DC}..."
33
37
34
38
for testCase in $tests ; do
35
39
# GitHub Actions grouping
36
- echo " ::group::$testCase "
37
40
echo -e " ${YELLOW} $testCase ${NORMAL} "
41
+
42
+ inCIEnvironment && echo " ::group::$testCase "
38
43
pushd $testCase
39
44
40
45
if [ -f .needs_dcd ]; then
@@ -46,22 +51,24 @@ for testCase in $tests; do
46
51
fi
47
52
48
53
dub upgrade 2>&1
54
+
49
55
dub --compiler=" ${DC} " 2>&1
50
56
if [[ $? -eq 0 ]]; then
57
+ inCIEnvironment && echo " ::endgroup::"
51
58
echo -e " ${YELLOW} $testCase :${NORMAL} ... ${GREEN} Test Pass${NORMAL} " ;
52
59
let pass_count=pass_count+1
53
60
else
61
+ inCIEnvironment && echo " ::endgroup::"
54
62
echo -e " ${YELLOW} $testCase :${NORMAL} ... ${RED} Test Fail${NORMAL} " ;
55
63
let fail_count=fail_count+1
56
64
fi
57
65
58
66
popd
59
- echo " ::endgroup::"
60
67
done
61
68
62
69
if [[ $fail_count -eq 0 ]]; then
63
70
echo -e " ${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL} "
64
71
else
65
72
echo -e " ${RED}${pass_count} tests passed and ${fail_count} failed.${NORMAL} "
66
73
exit 1
67
- fi
74
+ fi
0 commit comments