From 01241f2ded2722ff0500a28745ccfec82d1ce831 Mon Sep 17 00:00:00 2001 From: connoraird Date: Thu, 13 Nov 2025 14:34:40 +0000 Subject: [PATCH 1/2] gh-22: Add steps to regression-test workflow to comment on a PR if regression tests fail --- .github/workflows/regression-test.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/regression-test.yaml b/.github/workflows/regression-test.yaml index d686a6f..3a9b685 100644 --- a/.github/workflows/regression-test.yaml +++ b/.github/workflows/regression-test.yaml @@ -32,6 +32,9 @@ on: required: true type: string +env: + REGRESSION_TEST_OUTPUT_FILE: output.txt + jobs: regression-test: name: Regression test @@ -69,3 +72,25 @@ jobs: run: >- nox -s regression_tests-${{ matrix.python-version }} -- ${{ inputs.starting_revision }} ${{ inputs.end_revision }} + | tee $REGRESSION_TEST_OUTPUT_FILE + + - name: Extract regression information for PR comment + id: extract_comment + if: failure() + 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 + if: failure() + with: + message: >- + ${{ steps.extract_comment.outputs.PR_COMMENT_MSG }} From 635c70e1c4a4863fafa1aa180cce9472c2017f0f Mon Sep 17 00:00:00 2001 From: connoraird Date: Thu, 13 Nov 2025 14:44:00 +0000 Subject: [PATCH 2/2] Remove comment writing and just upload artifact to be extracted by the workflow in the glass repo --- .github/workflows/regression-test.yaml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/regression-test.yaml b/.github/workflows/regression-test.yaml index 3a9b685..cc8dba0 100644 --- a/.github/workflows/regression-test.yaml +++ b/.github/workflows/regression-test.yaml @@ -74,23 +74,8 @@ jobs: ${{ inputs.starting_revision }} ${{ inputs.end_revision }} | tee $REGRESSION_TEST_OUTPUT_FILE - - name: Extract regression information for PR comment - id: extract_comment - if: failure() - 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 - if: failure() + - name: Upload artefact + uses: actions/upload-artifact@v5 with: - message: >- - ${{ steps.extract_comment.outputs.PR_COMMENT_MSG }} + name: regression_output + path: $REGRESSION_TEST_OUTPUT_FILE