Skip to content

Add runtime tests

Add runtime tests #7

# .github/workflows/update_regression_tests.yml
name: Update Regression Baseline
on:
# issue_comment:
# types: [created]
pull_request:
branches:
- main
jobs:
update_regression_tests:
name: update_regression_tests
# 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:
- 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 }} # using head_sha vs. head_ref makes this work for forks
lfs: true
fetch-depth: 0 # This ensures we can checkout main branch too
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Update baseline
if: github.event.pull_request.base.ref == 'main'
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
NEW_BASELINE=1 pytest -m regression
- name: Commit and push
if: github.event.pull_request.base.ref == 'main'
run: |
git add tests/regression_test_baselines.json
git commit -m "Update regression test baselines"
git push origin HEAD:${{ steps.comment-branch.outputs.head_ref }}