-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
name: Update Regression Baseline | ||
|
||
on: | ||
# issue_comment: # event runs on the default branch | ||
# types: [created] | ||
issue_comment: # trigger from comment; event runs on the default branch | ||
types: [created] | ||
pull_request: | ||
branches: | ||
- main | ||
|
@@ -20,9 +20,9 @@ jobs: | |
username: ${{ github.event.pull_request.user.login }} # ${{ github.actor }} | ||
|
||
steps: | ||
# - name: Get PR branch | ||
# uses: xt0rted/pull-request-comment-branch@v1 | ||
# id: comment-branch | ||
- name: Get PR branch | ||
uses: xt0rted/pull-request-comment-branch@v1 | ||
id: comment-branch | ||
|
||
- name: Checkout PR branch | ||
uses: actions/checkout@v3 | ||
|
@@ -46,13 +46,12 @@ jobs: | |
run: | | ||
git config --global user.name '$username' | ||
git config --global user.email '[email protected]' | ||
# # Check if regression test results exist in main branch | ||
# if [ -f 'git cat-file -e main:tests/regression_test_baselines.json' ]; then | ||
# git checkout main tests/regression_test_baselines.json | ||
# else | ||
# echo "No regression test results found in main branch" | ||
# fi | ||
# Check if regression test results exist in main branch | ||
if [ -f 'git cat-file -e main:tests/regression_test_baselines.json' ]; then | ||
git checkout main tests/regression_test_baselines.json | ||
else | ||
echo "No regression test results found in main branch" | ||
fi | ||
NEW_BASELINE=1 pytest -m regression | ||
- name: Add Baseline update report to PR comment | ||
|
@@ -70,12 +69,18 @@ jobs: | |
repo: context.repo.repo, | ||
body: `## New Baselines \n\`\`\`\n${TestReport}\n\`\`\`` | ||
}); | ||
- name: Commit and push | ||
if: github.event.pull_request.base.ref == 'main' | ||
run: | | ||
git add -f tests/regression_test_baselines.json # since it's in .gitignore | ||
git commit -m "Update regression test baselines" | ||
# git push origin HEAD:${{ steps.comment-branch.outputs.head_sha }} | ||
git push origin HEAD:${{ github.head_ref }} | ||
git push origin HEAD:${{ github.head_ref }} | ||
# Needed when workflow is triggered from a comment | ||
# - name: Commit and push | ||
# if: github.event.pull_request.base.ref == 'main' | ||
# run: | | ||
# git add -f tests/regression_test_baselines.json # since it's in .gitignore | ||
# git commit -m "Update regression test baselines" | ||
# git push origin HEAD:${{ steps.comment-branch.outputs.head_sha }} |