Skip to content

[pre-commit.ci] pre-commit autoupdate #946

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #946

Workflow file for this run

---
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