@@ -82,6 +82,14 @@ function log(...args) {
82
82
console . log ( styleText ( "yellow" , text ) )
83
83
}
84
84
85
+ function logError ( ...args ) {
86
+ const text = args . join ( " " )
87
+ if ( GITHUB_ACTIONS_OUTPUT )
88
+ core . error ( styleText ( "red" , text ) )
89
+ else
90
+ console . error ( styleText ( "red" , text ) )
91
+ }
92
+
85
93
function logGroup ( name , body ) {
86
94
if ( GITHUB_ACTIONS_OUTPUT ) {
87
95
core . startGroup ( name ) ;
@@ -113,7 +121,7 @@ function sh(binary, args) {
113
121
try {
114
122
const result = spawnSync ( binary , args , SPAWN_OPTIONS ) ;
115
123
if ( result . status || result . error ) {
116
- console . error ( result . error ) ;
124
+ logError ( result . error ) ;
117
125
throw new Error ( `Shell CMD failed: ${ binary } ${ args . join ( " " ) } ` ) ;
118
126
}
119
127
} finally {
@@ -131,7 +139,6 @@ async function runTests() {
131
139
sh ( shellBinary , singleTestArgs ) ;
132
140
} ) ;
133
141
if ( ! success ) {
134
- console . error ( "TEST FAILURES" )
135
142
process . exit ( 1 )
136
143
}
137
144
}
@@ -173,7 +180,7 @@ function runTest(testName, test) {
173
180
try {
174
181
logGroup ( testName , test )
175
182
} catch ( e ) {
176
- console . error ( "TEST FAILED" )
183
+ logError ( "TEST FAILED" )
177
184
return false
178
185
}
179
186
return true
0 commit comments