Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/regression-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,37 @@ jobs:
with:
starting_revision: ${{ github.event.pull_request.base.ref }}
end_revision: ${{ github.event.pull_request.head.ref }}

write-pr-comment:
name: Write PR Comment
runs-on: ubuntu-latest
needs: regression-tests
if: ${{ failure() }}
env:
REGRESSION_TEST_OUTPUT_FILE: output.txt

steps:
- name: Download distributions
uses: actions/download-artifact@v6
with:
name: regression_output
path: $REGRESSION_TEST_OUTPUT_FILE

- name: Extract regression information for PR comment
id: extract_comment
run: >-
f=$REGRESSION_TEST_OUTPUT_FILE

start=$(grep -n -m1 'Performance has regressed:' "$f" | cut -d: -f1)
|| { echo "No match"; exit 1; }
s_dash=$(awk -v n=$start 'NR<=n && /^-+$/ {l=NR} END{print l}' "$f")
e_dash=$(awk -v n=$start 'NR>=n && /^-+$/ {print NR; exit}' "$f")
PR_COMMENT_MSG=$(sed -n "${s_dash},${e_dash}p" "$f")

echo "PR_COMMENT_MSG=$PR_COMMENT_MSG" >> $GITHUB_OUTPUT

- name: Write PR comment
uses: mshick/add-pr-comment@v2
with:
message: >-
${{ steps.extract_comment.outputs.PR_COMMENT_MSG }}
Loading