about summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-03-04 18:26:11 +0100
committerJakub Beránek <berykubik@gmail.com>2025-03-07 09:43:52 +0100
commitd5da6b71fa7f29946a41d624e038c1c0eed8a4d3 (patch)
tree93ac1c14f980dd9cd2a923668e4c7008bdc7fc8c /.github/workflows
parent91a0e1604f343730022bc903cbf201d8b0a86a71 (diff)
downloadrust-d5da6b71fa7f29946a41d624e038c1c0eed8a4d3.tar.gz
rust-d5da6b71fa7f29946a41d624e038c1c0eed8a4d3.zip
Add post-merge analysis CI workflow
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/post-merge.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml
new file mode 100644
index 00000000000..d3f42c5a905
--- /dev/null
+++ b/.github/workflows/post-merge.yml
@@ -0,0 +1,36 @@
+# Workflow that runs after a merge to master, analyses changes in test executions
+# and posts the result to the merged PR.
+
+name: Post merge analysis
+
+on:
+  push:
+    branches:
+      - master
+
+jobs:
+  analysis:
+    runs-on: ubuntu-24.04
+    if: github.repository == 'rust-lang/rust'
+    permissions:
+      pull-requests: write
+    steps:
+      - uses: actions/checkout@v4
+      - name: Perform analysis and send PR
+        run: |
+          # Get closest bors merge commit
+          PARENT_COMMIT=`git rev-list --author='bors <bors@rust-lang.org>' -n1 --first-parent HEAD^1`
+
+          # Find PR for the current commit
+          HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'`
+
+          echo "Parent: ${PARENT_COMMIT}"
+          echo "HEAD: ${{ github.sha }} (#${HEAD_PR})"
+
+          cd src/ci/citool
+
+          echo "Post-merge analysis result" > output.log
+          cargo run --release post-merge-analysis ${PARENT_COMMIT} ${{ github.sha }} >> output.log
+          cat output.log
+
+          gh pr comment ${HEAD_PR} -F output.log