build(deps): bump actions/cache from 4.2.0 to 4.2.1 #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Build Python Package | |
on: | |
push: | |
branches: | |
- '**' | |
- '!main' | |
- '!master' | |
pull_request: | |
workflow_call: | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
runner: | |
- ubuntu-latest | |
- ubuntu-24.04-arm | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cached models | |
id: cache-mods | |
uses: actions/[email protected] | |
with: | |
path: ~/.cache/huggingface/hub/models--wybxc--DocLayout-YOLO-DocStructBench-onnx | |
key: ${{runner.os}}-huggingmodel-wybxc--DocLayout-YOLO-DocStructBench-onnx | |
- name: Setup uv with Python ${{ matrix.python-version }} | |
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
enable-cache: true | |
cache-dependency-glob: "pyproject.toml" | |
- name: Install dependencies | |
run: | | |
uv sync | |
- name: Test - Unit Test | |
run: | | |
uv run pytest . | |
- name: Test - Translate a PDF file with plain text only | |
run: uv run pdf2zh ./test/file/translate.cli.plain.text.pdf -o ./test/file | |
- name: Test - Translate a PDF file figure | |
run: uv run pdf2zh ./test/file/translate.cli.text.with.figure.pdf -o ./test/file | |
# - name: Test - Translate a PDF file with unknown font | |
# run: | |
# pdf2zh ./test/file/translate.cli.font.unknown.pdf | |
- name: Test - Start GUI and exit | |
run: timeout 10 uv run pdf2zh -i || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | |
- name: Build as a package | |
run: uv build | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results-${{ matrix.python-version }}-${{ matrix.runner }} | |
path: ./test/file/ |