From 8cfc2769646d077b7c49ca6e63fcb4789c753bdd Mon Sep 17 00:00:00 2001 From: jnsbck-uni Date: Fri, 22 Nov 2024 14:17:04 +0100 Subject: [PATCH] wip: run regression tests --- .github/workflows/regression_tests.yml | 28 +++++++++---------- .../workflows/update_regression_baseline.yml | 10 +++++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 5a98e73b..2899ad04 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -2,9 +2,9 @@ name: Regression Tests on: - # pull_request: - # branches: - # - main + pull_request: + branches: + - main jobs: regression_tests: @@ -27,17 +27,17 @@ jobs: python -m pip install --upgrade pip pip install -e ".[dev]" - # - 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 - # pytest -m regression - # git checkout + - 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 + pytest -m regression + git checkout - name: Run benchmarks and compare to baseline if: github.event.pull_request.base.ref == 'main' diff --git a/.github/workflows/update_regression_baseline.yml b/.github/workflows/update_regression_baseline.yml index 1f69d625..89ca74e6 100644 --- a/.github/workflows/update_regression_baseline.yml +++ b/.github/workflows/update_regression_baseline.yml @@ -1,17 +1,21 @@ # .github/workflows/update_regression_tests.yml + +# for details on triggering a workflow from a comment, see: +# https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 name: Update Regression Baseline on: issue_comment: # trigger from comment; event runs on the default branch types: [created] - pull_request: - branches: - - main + # pull_request: + # branches: + # - main jobs: update_regression_tests: name: update_regression_tests runs-on: ubuntu-20.04 + # Trigger from a comment # if: github.event.issue.pull_request && contains(github.event.comment.body, '/update_baseline') permissions: contents: write