Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add rich build information for github workflows #133197

Conversation

boomanaiden154
Copy link
Contributor

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.

@boomanaiden154
Copy link
Contributor Author

This is stacked on #133196.

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Mar 27, 2025
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.

Pull Request: llvm#133197
@DavidSpickett
Copy link
Collaborator

TIL that https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-job-summary exists, very cool.

The title of the PR implies that you are adding more than test results, but the PR description says you are deliberately not adding anything more than test results right now. I would clarify the title.

I agree with the strategy, have 2 distinct entry points for a time, stick to test results only. Once Buildkite is removed you can start using all sorts of GitHub data to link log files and whatever we want to do. Without worrying about Buildkite.

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Mar 27, 2025
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.

Pull Request: llvm#133197
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Mar 27, 2025
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.

Pull Request: llvm#133197
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4
@llvmbot llvmbot added the mlir label Mar 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 27, 2025

@llvm/pr-subscribers-github-workflow

@llvm/pr-subscribers-mlir

Author: Aiden Grossman (boomanaiden154)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/133197.diff

4 Files Affected:

  • (added) .ci/generate_test_report_github.py (+23)
  • (modified) .ci/monolithic-linux.sh (+3)
  • (modified) .ci/monolithic-windows.sh (+3)
  • (modified) mlir/CMakeLists.txt (+1)
diff --git a/.ci/generate_test_report_github.py b/.ci/generate_test_report_github.py
new file mode 100644
index 0000000000000..d4b2677c1ba93
--- /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, style = 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 c8d61efcf9e71..4b6e56b4a4eda 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 99474a1893082..8ccc875609a3f 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
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 9e786154a2b40..1903757b18f35 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -1,4 +1,5 @@
 # MLIR project.
+# Test comment.
 cmake_minimum_required(VERSION 3.20.0)
 set(LLVM_SUBPROJECT_TITLE "MLIR")
 

@boomanaiden154
Copy link
Contributor Author

(MLIR changes are just for testing everything, forgot the bot would add the label).

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this pull request Mar 27, 2025
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.

Pull Request: llvm#133197
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
Created using spr 1.3.4
@boomanaiden154 boomanaiden154 changed the base branch from users/boomanaiden154/main.ci-add-rich-build-information-for-github-workflows to main March 29, 2025 06:48
@boomanaiden154 boomanaiden154 merged commit 41c906f into main Mar 29, 2025
7 of 9 checks passed
@boomanaiden154 boomanaiden154 deleted the users/boomanaiden154/ci-add-rich-build-information-for-github-workflows branch March 29, 2025 06:48
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 29, 2025
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: llvm/llvm-project#133197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants