Repository navigation
64 lines (54 loc) · 1.96 KB
/
Copy pathpython-tests.yml
File metadata and controls
64 lines (54 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Tests
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
pytest:
name: pytest (Python 3.12 / Windows)
# 依赖 pywin32,且部分测试校验 Windows 文件共享行为,故与构建工作流保持一致
runs-on: windows-latest
timeout-minutes: 30
env:
PYTHONUTF8: "1"
QT_QPA_PLATFORM: offscreen
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements.txt
- name: Install dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt "pyinstaller>=6.19.0"
# .qm 由 .gitignore 排除,测试需要运行时翻译目录,因此在此重新生成。
- name: Compile translation catalogs
shell: pwsh
run: |
pyside6-lrelease src/ui/en_US.ts -qm src/en_US.qm
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pyside6-lrelease src/ui/de_DE.ts -qm src/de_DE.qm
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pyside6-lrelease src/ui/ja_JP.ts -qm src/ja_JP.qm
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pyside6-lrelease src/ui/pl_PL.ts -qm src/pl_PL.qm
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python develop_tools/compile_plugin_translations.py
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Run tests
shell: pwsh
run: python -m pytest --junitxml=pytest-results.xml
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-results-windows-py312
path: pytest-results.xml
if-no-files-found: warn