[llvm] [Github][RFC] Add workflow to diff codegen on llvm-test-suite (PR #190010)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 03:46:54 PDT 2026


================
@@ -0,0 +1,139 @@
+# When /test-suite is commented on a PR, checks out the PR, builds clang and
+# then the test-suite in several configurations. It then checks out the base of
+# the PR, builds clang and the test-suite again, and then uploads the diff of
+# the codegen.
+
+name: Diff test-suite codegen
+
+on:
+  issue_comment:
+    types:
+      - created
+
+permissions:
+  contents: read
+
+jobs:
+  test-suite:
+    name: Build test-suite and diff
+    runs-on: ubuntu-24.04
+    container:
+      image: ghcr.io/llvm/ci-ubuntu-24.04:35e958d7f0b7
+    if: github.event.issue.pull_request && startswith(github.event.comment.body, '/test-suite')
+    steps:
+      - name: Get pull request
+        id: get-pr
+        uses: actions/github-script at ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+        with:
+          script: |
+            const { data: pr } = await github.rest.pulls.get({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              pull_number: context.payload.issue.number
+            })
+            return pr
+      - name: Check pull request is mergeable
+        if: ${{ !fromJSON(steps.get-pr.outputs.result).mergeable }}
+        run: |
+          cat << EOF > comments
+          [{"body": "Unable to diff test-suite with PR, PR isn't mergeable"}]
+          EOF
+          exit 1
+      - name: Checkout pull request
+        uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+        with:
+          ref: ${{ fromJSON(steps.get-pr.outputs.result).merge_commit_sha }}
+          repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }}
+          fetch-depth: 2
+          path: llvm-project
+          persist-credentials: false
+      - name: Checkout llvm/llvm-test-suite
+        uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+        with:
+          repository: llvm/llvm-test-suite
+          path: llvm-test-suite
+          persist-credentials: false
+      - name: Setup environment variables
+        run: |
+          echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
+          echo "BASE_SHA=$(git rev-parse HEAD^)" >> $GITHUB_ENV
+          SCRIPTS_DIR="$GITHUB_WORKSPACE/llvm-project/.github/workflows/test-suite"
+          echo "SCRIPTS_DIR=$SCRIPTS_DIR" >> $GITHUB_ENV
+          echo "$SCRIPTS_DIR" >> $GITHUB_PATH
+          echo "$GITHUB_WORKSPACE/llvm-project/build/bin" >> $GITHUB_PATH
+        working-directory: llvm-project
+      - name: Install system dependencies
+        run: |
+          # Install newer version of CMake (llvm/ci-ubuntu-24.04 image has CMake 3.28)
----------------
lukel97 wrote:

Done in https://github.com/llvm/llvm-project/pull/190010/commits/9aa79302060b9e51ba97b733d6ff210e0d12d614

https://github.com/llvm/llvm-project/pull/190010


More information about the llvm-commits mailing list