From 45d99ac52bfef8ff8ac939346895e3e1530af72a Mon Sep 17 00:00:00 2001 From: Moses Paul R Date: Wed, 11 Dec 2024 01:06:26 +0400 Subject: [PATCH] Add Windows test runner (#21) * run on both ubuntu and windows --- .github/workflows/tests.yml | 13 +++++++++---- benchmark.py | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9239f8..55d3561 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,19 +7,24 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: python-version: 3.11 - - name: Install python dependencies + + - name: Install Python dependencies run: | pip install poetry poetry install + - name: Run detection benchmark test run: | poetry run python benchmark.py --max 5 --result_path results --pdftext_only - poetry run python scripts/verify_benchmark_scores.py results/results.json - + poetry run python scripts/verify_benchmark_scores.py results/results.json diff --git a/benchmark.py b/benchmark.py index b134386..2ecdaf2 100644 --- a/benchmark.py +++ b/benchmark.py @@ -80,7 +80,7 @@ def main(): row = dataset[i] pdf = row["pdf"] tool_pages = {} - with tempfile.NamedTemporaryFile(suffix=".pdf") as f: + with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as f: f.write(pdf) f.seek(0) pdf_path = f.name