Skip to content

Commit d9f3d49

Browse files
authored
Rollup merge of rust-lang#114573 - Kobzol:ci-no-group-on-error, r=oli-obk
CI: do not hide error logs in a group This PR avoids creating a GHA group at the very end of a CI workflow when some failure has happened. Before, when a failure has happened, its GHA group was not closed, however the clock drift check function would create a new group, which would actually close the group containing the error log, thus making errors hidden by default, which is not ideal. See discussion here: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/GHA.20groups.20being.20closed.20on.20failures r? bootstrap
2 parents e7b7362 + 8d33608 commit d9f3d49

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Diff for: src/ci/run.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,25 @@ fi
154154
# check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure
155155
# Pipelines it happened that the certificates were marked as expired.
156156
datecheck() {
157-
echo "::group::Clock drift check"
157+
# If an error has happened, we do not want to start a new group, because that will collapse
158+
# a previous group that might have contained the error log.
159+
exit_code=$?
160+
161+
if [ $exit_code -eq 0 ]
162+
then
163+
echo "::group::Clock drift check"
164+
fi
165+
158166
echo -n " local time: "
159167
date
160168
echo -n " network time: "
161169
curl -fs --head http://ci-caches.rust-lang.org | grep ^Date: \
162170
| sed 's/Date: //g' || true
163-
echo "::endgroup::"
171+
172+
if [ $exit_code -eq 0 ]
173+
then
174+
echo "::endgroup::"
175+
fi
164176
}
165177
datecheck
166178
trap datecheck EXIT

0 commit comments

Comments
 (0)