From 4d70bd978b966ab4ec0d9958787d6ad453303cd8 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Thu, 28 Mar 2024 19:46:06 +0200 Subject: [PATCH] WIP: Fix Windows and macOS CI --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 914c94281..8e069d4f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,28 @@ on: - cron: '0 0 * * *' # Run every day at 00:00 UTC. jobs: + download-tessdata: + name: Download and cache Tesseract data + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cache Tessdata + id: cache-tessdata + uses: actions/cache@v4 + with: + path: share/tessdata/ + key: v1-tessdata-${{ hashFiles('./install/common/download-tessdata.py') }} + enableCrossOsArchive: true + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Download Tessdata + if: steps.cache-tessdata.outputs.cache-hit != 'true' + run: python3 ./install/common/download-tessdata.py + windows: runs-on: windows-latest + needs: download-tessdata env: DUMMY_CONVERSION: True steps: @@ -18,6 +38,13 @@ jobs: python-version: '3.11' - run: pip install poetry - run: poetry install + - name: Restore cached tessdata + uses: actions/cache/restore@v4 + with: + path: share/tessdata/ + enableCrossOsArchive: true + fail-on-cache-miss: true + key: v1-tessdata-${{ hashFiles('./install/common/download-tessdata.py') }} - name: Run CLI tests run: poetry run make test # Taken from: https://github.com/orgs/community/discussions/27149#discussioncomment-3254829 @@ -37,6 +64,13 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.11' + - name: Restore cached tessdata + uses: actions/cache/restore@v4 + with: + path: share/tessdata/ + enableCrossOsArchive: true + fail-on-cache-miss: true + key: v1-tessdata-${{ hashFiles('./install/common/download-tessdata.py') }} - run: pip install poetry - run: poetry install - name: Run CLI tests