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
25 changes: 24 additions & 1 deletion .github/workflows/regression-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
- reopened
- synchronize

env:
REGRESSION_TEST_OUTPUT_FILE: output.txt

jobs:
regression-tests:
if: github.event.pull_request.draft == false
Expand Down Expand Up @@ -52,10 +55,30 @@ jobs:
run: uv sync --only-dev

- name: Run regression test
continue-on-error: true
run: >-
uv run nox -s regression_tests-${{ matrix.python-version }} --
"$BASE_REF" "$HEAD_REF"
"${BASE_REF}" "${HEAD_REF}" | tee ${REGRESSION_TEST_OUTPUT_FILE}
env:
BASE_REF: ${{ github.event.pull_request.base.ref }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
FORCE_COLOR: 1

- 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
if: failure()
uses: mshick/add-pr-comment@v2
with:
message: >-
${{ steps.extract_comment.outputs.PR_COMMENT_MSG }}
Loading