From adcc52add0f829f666bffaced6f2d9fd5809a960 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 9 Dec 2024 13:46:07 -0800 Subject: [PATCH] Run OCR benchmarks on relevant pull rquests too --- .github/workflows/ocr-benchmarks.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ocr-benchmarks.yml b/.github/workflows/ocr-benchmarks.yml index 2b68b18d..94858526 100644 --- a/.github/workflows/ocr-benchmarks.yml +++ b/.github/workflows/ocr-benchmarks.yml @@ -1,5 +1,9 @@ name: OCR Poetry Benchmark Tests on: + pull_request: + paths: + - .github/workflows/ocr-benchmarks.yml + - OCR/** push: branches: - main @@ -16,6 +20,7 @@ jobs: python-version: "3.10" - name: Install dependencies run: | + sudo apt update && apt install tesseract-ocr-eng tesseract-ocr cd OCR/tests python -m pip install --upgrade pip pip install poetry @@ -25,22 +30,3 @@ jobs: run: | cd OCR/tests poetry run pytest benchmark_test.py -v --benchmark-json output.json - # - name: Store benchmark result - # uses: benchmark-action/github-action-benchmark@v1 - # with: - # tool: 'pytest' - # output-file-path: OCR/tests/output.json - # auto-push: false - # - name: Push benchmark result - # run: git push 'https://CDCgov:${{ secrets.GITHUB_TOKEN }}@github.com/CDCgov/IDWA.git' gh-pages:gh-pages - # - name: Fetch data.js from gh-pages - # run: | - # git config --global user.name 'GitHub Action' - # git config --global user.email 'action@github.com' - # git fetch - # git checkout gh-pages - # rm ./dev/bench/index.html - # cp ./dev/bench/index-template.html ./dev/bench/index.html - # git add . - # git commit -m "template to index" - # git push origin gh-pages