Skip to content

Commit 7a2fa83

Browse files
committed
Format yaml files
1 parent 05a9959 commit 7a2fa83

File tree

4 files changed

+155
-110
lines changed

4 files changed

+155
-110
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
version: 2
23
updates:
3-
- package-ecosystem: "github-actions"
4+
- package-ecosystem: "pip"
45
directory: "/"
56
schedule:
67
interval: "weekly"

.github/workflows/release.yml

Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
name: Release
23

3-
on:
4+
on: # yamllint disable-line rule:truthy
45
push:
56
tags:
67
- 'v*.*.*'
@@ -10,57 +11,69 @@ jobs:
1011
runs-on: ubuntu-latest
1112

1213
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-python@v4
15-
with:
16-
python-version: "3.11"
17-
- uses: snok/install-poetry@v1
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: "3.11"
18+
- uses: snok/install-poetry@v1
1819

19-
- name: Get tag
20-
id: tag
21-
run: echo version=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
20+
- name: Get tag
21+
id: tag
22+
run: echo version=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
2223

23-
- name: Build project for distribution
24-
run: poetry build
24+
- name: Build project for distribution
25+
run: poetry build
2526

26-
- name: Get wheel file path
27-
id: wheel-file-path
28-
run: echo path=$(ls dist/*.whl) >> $GITHUB_OUTPUT
27+
- name: Get wheel file path
28+
id: wheel-file-path
29+
run: echo path=$(ls dist/*.whl) >> $GITHUB_OUTPUT
2930

30-
- name: Install dependencies
31-
run: |
32-
python -m pip install PyQt6
33-
sudo apt-get update -y
34-
sudo apt-get install --no-install-recommends -y libxkbcommon-x11-0 x11-utils libyaml-dev libegl1-mesa libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libopengl0
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install PyQt6
34+
sudo apt-get update -y
35+
sudo apt-get install --no-install-recommends -y \
36+
libxkbcommon-x11-0 \
37+
x11-utils libyaml-dev \
38+
libegl1-mesa \
39+
libxcb-icccm4 \
40+
libxcb-image0 \
41+
libxcb-keysyms1 \
42+
libxcb-randr0 \
43+
libxcb-render-util0 \
44+
libxcb-xinerama0 \
45+
libopengl0
3546
36-
- name: Test build package
37-
run: |
38-
python -m pip install ${{ steps.wheel-file-path.outputs.path }}
39-
python tools/check_build_package.py --tag-version ${{ steps.tag.outputs.version }}
40-
python -m pip uninstall -y pyqtdarktheme
47+
- name: Test build package
48+
run: |
49+
python -m pip install ${{ steps.wheel-file-path.outputs.path }}
50+
python tools/check_build_package.py \
51+
--tag-version ${{ steps.tag.outputs.version }}
52+
python -m pip uninstall -y pyqtdarktheme
4153
42-
- name: Publish to testPyPI
43-
run: |
44-
poetry config repositories.testpypi https://test.pypi.org/legacy/
45-
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
46-
poetry publish -r testpypi
54+
- name: Publish to testPyPI
55+
run: |
56+
poetry config repositories.testpypi https://test.pypi.org/legacy/
57+
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
58+
poetry publish -r testpypi
4759
48-
- name: Waite until package is published
49-
run: sleep 120
60+
- name: Waite until package is published
61+
run: sleep 120
5062

51-
- name: Test testPyPI package
52-
run: |
53-
pip install -i https://test.pypi.org/simple/ pyqtdarktheme
54-
python tools/check_build_package.py --tag-version ${{ steps.tag.outputs.version }}
63+
- name: Test testPyPI package
64+
run: |
65+
pip install -i https://test.pypi.org/simple/ pyqtdarktheme
66+
python tools/check_build_package.py \
67+
--tag-version ${{ steps.tag.outputs.version }}
5568
56-
- name: Create Release
57-
uses: ncipollo/release-action@v1
58-
with:
59-
artifacts: "dist/*"
60-
token: ${{ secrets.GITHUB_TOKEN }}
61-
draft: false
69+
- name: Create Release
70+
uses: ncipollo/release-action@v1
71+
with:
72+
artifacts: "dist/*"
73+
token: ${{ secrets.GITHUB_TOKEN }}
74+
draft: false
6275

63-
- name: Publish to PyPI
64-
run: |
65-
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
66-
poetry publish
76+
- name: Publish to PyPI
77+
run: |
78+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
79+
poetry publish

.github/workflows/test.yml

Lines changed: 94 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
name: tests
2-
on:
3+
4+
on: # yamllint disable-line rule:truthy
35
pull_request:
46
push:
57
branches: [main]
@@ -44,66 +46,94 @@ jobs:
4446
name: ${{ matrix.os }} py-${{ matrix.py }} qt-${{ matrix.qt }}
4547

4648
steps:
47-
- uses: actions/checkout@v3
48-
- uses: actions/setup-python@v4
49-
with:
50-
python-version: ${{ matrix.py }}
51-
52-
- name: Get full Python version
53-
id: full-py-version
54-
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
55-
56-
- name: Cache ./.venv
57-
id: cache-venv
58-
uses: actions/[email protected]
59-
with:
60-
path: .venv
61-
key: venv-${{ runner.os }}-${{ steps.full-py-version.outputs.version }}-${{ matrix.qt }}-${{ hashFiles('**/poetry.lock') }}
62-
63-
- uses: snok/install-poetry@v1
64-
with:
65-
virtualenvs-in-project: true
66-
67-
- name: Install dependencies
68-
if: steps.cache-venv.outputs.cache-hit != 'true'
69-
run: poetry install --only dev,github-actions,test,main
70-
71-
- name: Install Qt dependencies
72-
if: matrix.qt != 'none' && steps.cache-venv.outputs.cache-hit != 'true'
73-
run: poetry run pip install -U ${{ matrix.qt }}
74-
75-
- name: Install Linux dependencies
76-
if: runner.os == 'Linux'
77-
run: |
78-
sudo apt-get update -y
79-
sudo apt-get install --no-install-recommends -y libxkbcommon-x11-0 x11-utils libyaml-dev libegl1-mesa libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libopengl0
80-
81-
- name: Run pytest
82-
if: matrix.qt != 'none'
83-
run: poetry run pytest --cov --cov-report=term-missing --cov-report=xml
84-
85-
- name: Run pytest without Qt lib
86-
if: matrix.qt == 'none'
87-
run: |
88-
poetry run pytest --cov --cov-report=term-missing --cov-report=xml --ignore=tests/test_widget_gallery.py --ignore=tests/test_qdarktheme_with_qt.py -p no:pytest-qt
89-
90-
- name: Upload coverage to Codecov
91-
uses: codecov/codecov-action@v3
92-
with:
93-
fail_ci_if_error: true
94-
token: ${{ secrets.CODECOV_TOKEN }}
95-
96-
- name: Capture img of WidgetGallery
97-
if: matrix.qt != 'none'
98-
run: poetry run python ./tools/capture.py -i ${{runner.os}}-py${{matrix.py}}-${{matrix.qt}} -d ${{ env.TEST_IMG_OUTPUT_PATH}}
99-
100-
- name: Archive img of WidgetGallery
101-
if: matrix.qt != 'none'
102-
uses: actions/upload-artifact@v3
103-
with:
104-
name: widget-img
105-
path: ./${{ env.TEST_IMG_OUTPUT_PATH}}/*.png
106-
107-
- name: Test freezing-pkg(PyInstaller)
108-
if: matrix.qt != 'none' && runner.os != 'Linux'
109-
run: poetry run python -m tools.test_freezing_lib
49+
- uses: actions/checkout@v3
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{ matrix.py }}
53+
54+
- name: Get full Python version
55+
id: full-py-version
56+
run: |
57+
echo version=$(python -c " \
58+
import sys; \
59+
print('-'.join(str(v) for v in sys.version_info)) \
60+
") >> $GITHUB_OUTPUT
61+
62+
- name: Cache ./.venv
63+
id: cache-venv
64+
uses: actions/[email protected]
65+
with:
66+
path: .venv
67+
key: |
68+
venv-\
69+
${{ runner.os }}-\
70+
${{ steps.full-py-version.outputs.version }}-\
71+
${{ matrix.qt }}-\
72+
${{ hashFiles('**/poetry.lock') }}
73+
74+
- uses: snok/install-poetry@v1
75+
with:
76+
virtualenvs-in-project: true
77+
78+
- name: Install dependencies
79+
if: steps.cache-venv.outputs.cache-hit != 'true'
80+
run: poetry install --only dev,github-actions,test,main
81+
82+
- name: Install Qt dependencies
83+
if: matrix.qt != 'none' && steps.cache-venv.outputs.cache-hit != 'true'
84+
run: poetry run pip install -U ${{ matrix.qt }}
85+
86+
- name: Install Linux dependencies
87+
if: runner.os == 'Linux'
88+
run: |
89+
sudo apt-get update -y
90+
sudo apt-get install --no-install-recommends -y \
91+
libxkbcommon-x11-0 \
92+
x11-utils libyaml-dev \
93+
libegl1-mesa \
94+
libxcb-icccm4 \
95+
libxcb-image0 \
96+
libxcb-keysyms1 \
97+
libxcb-randr0 \
98+
libxcb-render-util0 \
99+
libxcb-xinerama0 \
100+
libopengl0
101+
102+
- name: Run pytest
103+
if: matrix.qt != 'none'
104+
run: poetry run pytest --cov --cov-report=term-missing --cov-report=xml
105+
106+
- name: Run pytest without Qt lib
107+
if: matrix.qt == 'none'
108+
run: |
109+
poetry run pytest \
110+
--cov \
111+
--cov-report=term-missing \
112+
--cov-report=xml \
113+
--ignore=tests/test_widget_gallery.py \
114+
--ignore=tests/test_qdarktheme_with_qt.py \
115+
-p no:pytest-qt
116+
117+
- name: Upload coverage to Codecov
118+
uses: codecov/codecov-action@v3
119+
with:
120+
fail_ci_if_error: true
121+
token: ${{ secrets.CODECOV_TOKEN }}
122+
123+
- name: Capture img of WidgetGallery
124+
if: matrix.qt != 'none'
125+
run: |
126+
poetry run python ./tools/capture.py \
127+
-i ${{runner.os}}-py${{matrix.py}}-${{matrix.qt}} \
128+
-d ${{ env.TEST_IMG_OUTPUT_PATH}}
129+
130+
- name: Archive img of WidgetGallery
131+
if: matrix.qt != 'none'
132+
uses: actions/upload-artifact@v3
133+
with:
134+
name: widget-img
135+
path: ./${{ env.TEST_IMG_OUTPUT_PATH}}/*.png
136+
137+
- name: Test freezing-pkg(PyInstaller)
138+
if: matrix.qt != 'none' && runner.os != 'Linux'
139+
run: poetry run python -m tools.test_freezing_lib

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
ci:
23
# Replace use some hooks of pre-commit.ci with our own github actions.
34
# See https://github.com/pre-commit-ci/issues/issues/55.

0 commit comments

Comments
 (0)