-
Notifications
You must be signed in to change notification settings - Fork 3
120 lines (115 loc) · 3.89 KB
/
build.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Python package
on: [push]
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, windows-latest, ubuntu-22.04]
python-version: ["3.11", "3.12"]
runs-on: ${{ matrix.platform }}
env:
DISPLAY: ":99.0"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: tlambert03/setup-qt-libs@v1
- name: Linux opengl
if: runner.os == 'Linux'
run: sudo apt-get install -y libopengl0 libegl1-mesa libxcb-xinput0 libpulse0
# - name: start TextToSpeech service
# if: runner.os == 'Linux'
# run: |
# sudo apt-get install speech-dispatcher espeak
# speech-dispatcher -d
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Install dependencies
run: |
uv sync
- name: Test with pytest (PyQt6)
# combine test coverage with --cov-append?
uses: coactions/setup-xvfb@v1
timeout-minutes: 5
with:
run: |
uv sync --extra pyqt6 --extra addons
uv run pytest
- name: Test with pytest (PySide6)
uses: coactions/setup-xvfb@v1
# if: runner.os == 'Linux'
timeout-minutes: 5
with:
run: |
uv sync --extra pyside6 --extra addons
uv run pytest --doctest-modules --junitxml=junit/test-results.xml --cov=prettyqt --cov-report=xml --cov-report=html
- name: Upload coverage to Codecov
if: runner.os == 'Windows' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Create documentation
# combine test coverage with --cov-append?
# if: matrix.python-version == '3.11' && runner.os == 'Linux'
uses: coactions/setup-xvfb@v1
timeout-minutes: 10
with:
run: |
uv sync --extra pyside6 --extra addons
uv run mkdocs build
# - name: Build and publish
# if: startsWith(github.ref, 'refs/tags/v') && matrix.python-version == '3.11' && runner.os == 'Linux'
# run: |
# poetry config pypi-token.pypi ${{ secrets.PYPI_SECRET }}
# poetry publish --build
# - name: Deploy docs
# if: startsWith(github.ref, 'refs/tags/v') && matrix.python-version == '3.11' && runner.os == 'Linux'
# uses: peaceiris/actions-gh-pages@v4
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./site
deploy:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install packages
# if: runner.os == 'Linux'
run: |
uv sync --extra pyside6 --extra addons
- name: Build documentation
uses: coactions/setup-xvfb@v1
timeout-minutes: 10
with:
run: |
uv run mkdocs build
- name: Build
run: |
uv build
- name: Publish on PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
run: |
uv publish
# - name: Deploy docs
# # if: github.event_name == 'push'
# uses: mhausenblas/mkdocs-deploy-gh-pages@master
# # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # CUSTOM_DOMAIN: optionaldomain.com
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site