Skip to content

Commit

Permalink
Add post-merge analysis CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Mar 5, 2025
1 parent ac951d3 commit 6ec42d7
Show file tree
Hide file tree
Showing 7 changed files with 975 additions and 13 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>' -n1 --first-parent HEAD^1`
# Find PRs for current and parent 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
2 changes: 1 addition & 1 deletion src/build_helper/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub struct Test {
pub outcome: TestOutcome,
}

#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash)]
#[serde(tag = "outcome", rename_all = "snake_case")]
pub enum TestOutcome {
Passed,
Expand Down
Loading

0 comments on commit 6ec42d7

Please sign in to comment.