-
-
Notifications
You must be signed in to change notification settings - Fork 90
105 lines (91 loc) · 2.96 KB
/
test.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
name: tests
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [main]
jobs:
pytest:
strategy:
fail-fast: false
matrix: # Test each python and Qt-lib only once on each os.
os: [ubuntu-latest, macOS-latest, windows-latest]
py: ['3.7', '3.8', '3.9', '3.10', '3.11']
include:
- {py: '3.7', qt: PyQt5~=5.15.0}
- {py: '3.8', qt: PySide2~=5.15.0}
- {py: '3.9', qt: PyQt6}
- {py: '3.10', qt: PySide6-Essentials}
- {py: '3.11', qt: PyQt6}
runs-on: ${{ matrix.os }}
name: pytest (${{ matrix.os }}, ${{ matrix.py }}, ${{ matrix.qt }})
steps:
- uses: actions/checkout@v3
- uses: tlambert03/setup-qt-libs@v1
- uses: 5yutan5/[email protected]
with:
python-version: ${{ matrix.py }}
additional-dependency-cache-key: ${{ matrix.qt }}
poetry-install--only: github-actions,test,main
- run: poetry run pip install -U ${{ matrix.qt }}
- run: >-
poetry run pytest tests --color=yes
--cov=qdarktheme
--cov=tests
--cov-report=term-missing
--cov-report=xml
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Capture WidgetGallery img
run: >-
poetry run python ./tools/capture.py
--name ${{runner.os}}-py${{matrix.py}}-${{matrix.qt}}
- uses: actions/upload-artifact@v3
with:
path: ./*.png
pytest-without-qt:
strategy:
fail-fast: false
matrix: # Python version does not affect tests without Qt.
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: 5yutan5/[email protected]
with:
python-version: '3.11'
poetry-install--only: github-actions,test,main
- run: >-
poetry run pytest --color=yes
--cov=qdarktheme
--cov=tests
--cov-report=term-missing
--cov-report=xml
--ignore=tests/test_widget_gallery.py
--ignore=tests/test_qdarktheme_with_qt.py
-p no:pytest-qt
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
PyInstaller:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: 5yutan5/[email protected]
with:
python-version: '3.11'
poetry-install--only: main
additional-dependency-cache-key: PyInstaller
- run: poetry run pip install -U PyInstaller
- name: Make test file
run: |
cat <<'EOL' >> test.py
import qdarktheme
qdarktheme.load_stylesheet('auto')
EOL
cat -n test.py
- run: poetry run python -m PyInstaller test.py -n test_app -F
- run: ./dist/test_app