Skip to content

Commit

Permalink
wip: baseline trigger added on pr to get the first baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsbck committed Nov 21, 2024
1 parent 61c577c commit a20bbd2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
- name: Run benchmarks and compare to baseline
if: github.event.pull_request.base.ref == 'main'
run: |
# 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
pytest -m regression
git checkout
# git checkout
31 changes: 15 additions & 16 deletions .github/workflows/update_regression_baseline.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# .github/workflows/regression_tests.yml
# .github/workflows/update_regression_tests.yml
name: Update Regression Baseline

on:
issue_comment:
types: [created]

# issue_comment:
# types: [created]
pull_request:
branches:
- main

jobs:
regression_tests:
update_regression_tests:
name: regression_tests
if: github.event.issue.pull_request && contains(github.event.comment.body, '/update_baseline')
# if: github.event.issue.pull_request && contains(github.event.comment.body, '/update_baseline')
runs-on: ubuntu-20.04
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3
- name: Get PR branch
uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch

- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
lfs: true
fetch-depth: 0 # This ensures we can checkout main branch too

Expand All @@ -30,15 +38,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Get PR branch
uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch

- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Update baseline
if: github.event.pull_request.base.ref == 'main'
Expand Down

0 comments on commit a20bbd2

Please sign in to comment.