|
@@ -1,4 +1,4 @@
|
|
|
-name: Build Python Package
|
|
|
|
|
|
|
+name: Test and Build Python Package
|
|
|
|
|
|
|
|
on:
|
|
on:
|
|
|
push:
|
|
push:
|
|
@@ -22,10 +22,22 @@ jobs:
|
|
|
python -m pip install --upgrade pip
|
|
python -m pip install --upgrade pip
|
|
|
pip install build flake8 black
|
|
pip install build flake8 black
|
|
|
|
|
|
|
|
- - name: Check code format
|
|
|
|
|
|
|
+ - name: Test - Code format
|
|
|
run: |
|
|
run: |
|
|
|
black --check --diff --color pdf2zh/*.py
|
|
black --check --diff --color pdf2zh/*.py
|
|
|
flake8 --ignore E203,E261,E501,W503,E741
|
|
flake8 --ignore E203,E261,E501,W503,E741
|
|
|
|
|
|
|
|
- - name: Build package
|
|
|
|
|
|
|
+ - name: Test - Local installation
|
|
|
|
|
+ run:
|
|
|
|
|
+ python -m pip install -e .
|
|
|
|
|
+
|
|
|
|
|
+ - name: Test - Translate a PDF file with plain text only
|
|
|
|
|
+ run:
|
|
|
|
|
+ pdf2zh ./test/file/translate.cli.plain.text.pdf
|
|
|
|
|
+
|
|
|
|
|
+ - name: Test - Start GUI and exit
|
|
|
|
|
+ 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
|
|
run: python -m build
|