aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAiden Grossman <aidengrossman@google.com>2025-03-28 23:48:20 -0700
committerGitHub <noreply@github.com>2025-03-28 23:48:20 -0700
commit41c906fe2b62a8266874a1146b9c85d96f1fa8fa (patch)
treed8fbb2b011b210ed4f1aa742088e5983a313c3e9
parent21eeca3db0341fef4ab4a6464ffe38b2eba5810c (diff)
downloadllvm-41c906fe2b62a8266874a1146b9c85d96f1fa8fa.zip
llvm-41c906fe2b62a8266874a1146b9c85d96f1fa8fa.tar.gz
llvm-41c906fe2b62a8266874a1146b9c85d96f1fa8fa.tar.bz2
[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: https://github.com/llvm/llvm-project/pull/133197
-rw-r--r--.ci/generate_test_report_github.py23
-rwxr-xr-x.ci/monolithic-linux.sh3
-rwxr-xr-x.ci/monolithic-windows.sh3
3 files changed, 29 insertions, 0 deletions
diff --git a/.ci/generate_test_report_github.py b/.ci/generate_test_report_github.py
new file mode 100644
index 0000000..5f88513
--- /dev/null
+++ b/.ci/generate_test_report_github.py
@@ -0,0 +1,23 @@
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+"""Script to generate a build report for Github."""
+
+import argparse
+
+import generate_test_report_lib
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "title", help="Title of the test report, without Markdown formatting."
+ )
+ parser.add_argument("return_code", help="The build's return code.", type=int)
+ parser.add_argument("junit_files", help="Paths to JUnit report files.", nargs="*")
+ args = parser.parse_args()
+
+ report, _ = generate_test_report_lib.generate_report_from_files(
+ args.title, args.return_code, args.junit_files, None
+ )
+
+ print(report)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index c8d61ef..4b6e56b 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -40,6 +40,9 @@ function at-exit {
then
python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":linux: Linux x64 Test Results" \
"linux-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
+ else
+ python3 "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":linux: Linux x64 Test Results" \
+ $retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
fi
}
trap at-exit EXIT
diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh
index 99474a1..8ccc875 100755
--- a/.ci/monolithic-windows.sh
+++ b/.ci/monolithic-windows.sh
@@ -39,6 +39,9 @@ function at-exit {
then
python "${MONOREPO_ROOT}"/.ci/generate_test_report_buildkite.py ":windows: Windows x64 Test Results" \
"windows-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
+ else
+ python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py ":windows: Windows x64 Test Results" \
+ $retcode "${BUILD_DIR}"/test-results.*.xml >> $GITHUB_STEP_SUMMARY
fi
}
trap at-exit EXIT