diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab5c46b..35e3618 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,30 +6,11 @@ env: TORCH_DEVICE: "cpu" jobs: - build-ubuntu: - name: Build on Ubuntu - runs-on: ubuntu-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 - 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 - - build-windows: - name: Build on Windows - runs-on: windows-latest + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest-large] steps: - uses: actions/checkout@v3 diff --git a/benchmark.py b/benchmark.py index b134386..445e2ad 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", mode='w') as f: f.write(pdf) f.seek(0) pdf_path = f.name