Skip to content

Commit 41c906f

Browse files
[CI] Add rich build information for github workflows
This patch adds rich test failure information to the Github output, using the same library that is used for the buildkite pipeline. Eventually I think we want to add more information like reproduction information using the containers, but that is very divergent between Github and Buildkite, so we probably want to wait until we've switched over before doing that. Reviewers: Keenuts, tstellar, lnihlen, DavidSpickett Reviewed By: DavidSpickett, Keenuts Pull Request: #133197
1 parent 21eeca3 commit 41c906f

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.ci/generate_test_report_github.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
"""Script to generate a build report for Github."""
5+
6+
import argparse
7+
8+
import generate_test_report_lib
9+
10+
if __name__ == "__main__":
11+
parser = argparse.ArgumentParser()
12+
parser.add_argument(
13+
"title", help="Title of the test report, without Markdown formatting."
14+
)
15+
parser.add_argument("return_code", help="The build's return code.", type=int)
16+
parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
17+
args = parser.parse_args()
18+
19+
report, _ = generate_test_report_lib.generate_report_from_files(
20+
args.title, args.return_code, args.junit_files, None
21+
)
22+
23+
print(report)

.ci/monolithic-linux.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function at-exit {
4040
then
4141
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":linux: Linux x64 Test Results" \
4242
"linux-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
43+
else
44+
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":linux: Linux x64 Test Results" \
45+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
4346
fi
4447
}
4548
trap at-exit EXIT

.ci/monolithic-windows.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ function at-exit {
3939
then
4040
python "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":windows: Windows x64 Test Results" \
4141
"windows-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
42+
else
43+
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":windows: Windows x64 Test Results" \
44+
$retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
4245
fi
4346
}
4447
trap at-exit EXIT

0 commit comments

Comments
 (0)