Skip to content

Commit

Permalink
Merge pull request #411 from timelic/cache-action-pip-install
Browse files Browse the repository at this point in the history
  • Loading branch information
Byaidu authored Jan 6, 2025
2 parents 6176b17 + 1f72033 commit 0276b91
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.11' # avoid bugs in new versions
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
Expand All @@ -24,26 +26,32 @@ jobs:
run: |
black --check --diff --color pdf2zh/*.py test/*.py
flake8 --ignore E203,E261,E501,W503,E741
- name: Test - Unit Test
run: |
pytest .
- name: Test - Translate a PDF file with plain text only
run:
run:
pdf2zh ./test/file/translate.cli.plain.text.pdf

- name: Test - Translate a PDF file figure
run:
run:
pdf2zh ./test/file/translate.cli.text.with.figure.pdf

# - name: Test - Translate a PDF file with unknown font
# run:
# run:
# pdf2zh ./test/file/translate.cli.font.unknown.pdf

- name: Test - Start GUI and exit
run:
run:
timeout 10 pdf2zh -i || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi

- name: Build as a package
run: python -m build

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./test/file/

0 comments on commit 0276b91

Please sign in to comment.