@@ -21,14 +21,13 @@ jobs:
2121 runs-on : ubuntu-latest
2222 steps :
2323 - uses : actions/checkout@v4
24- - uses : actions/setup-python@v5
25- with :
26- python-version : " 3.x"
27- - run : pip install check-manifest && check-manifest
24+ - run : pipx run check-manifest
2825
2926 test :
3027 name : ${{ matrix.platform }} (${{ matrix.python-version }})
3128 runs-on : ${{ matrix.platform }}
29+ env :
30+ UV_PRERELEASE : ${{ github.event_name == 'schedule' && 'allow' || 'if-necessary-or-explicit' }}
3231 strategy :
3332 fail-fast : false
3433 matrix :
@@ -38,88 +37,81 @@ jobs:
3837 steps :
3938 - uses : actions/checkout@v4
4039
41- - name : Set up Python ${{ matrix.python-version }}
42- uses : actions/setup-python@v5
40+ - uses : astral-sh/setup-uv@v6
4341 with :
4442 python-version : ${{ matrix.python-version }}
45- cache-dependency-path : " pyproject.toml"
46- cache : " pip"
47-
48- - uses : tlambert03/setup-qt-libs@v1
49-
50- - name : Install dependencies
43+ enable-cache : true
44+ cache-dependency-glob : " **/pyproject.toml"
5145
52- run : |
53- python -m pip install -U pip
54- python -m pip install -e .[test_min]
46+ - name : Run min test
47+ run : uv run --no-dev --group test_min pytest -v
5548
56- - name : Run test
57- run : pytest -v
49+ - uses : pyvista/setup-headless-display-action@v3
50+ with :
51+ qt : true
5852
59- - name : Install third-party dependencies
60- if : runner.os != 'Windows'
61- run : |
62- python -m pip install -e .[test_thirdparty] ${{ github.event_name == 'schedule' && '--pre' || '' }}
63- python -m pip install PyQt6==6.8.1
53+ - name : Run full test
54+ run : uv run --no-dev --group test_thirdparty coverage run -p -m pytest -v
6455
65- - name : Run test
66- if : runner.os != 'Windows'
67- 56+ - name : Upload coverage
57+ uses : actions/upload-artifact@v4
6858 with :
69- run : pytest -v --cov=cmap --cov-report=xml --cov-report=term-missing
59+ name : covreport-${{ matrix.platform }}-py${{ matrix.python-version }}
60+ path : ./.coverage*
61+ include-hidden-files : true
7062
71- - name : Coverage
72- if : runner.os != 'Windows'
73- uses : codecov/codecov-action@v5
74- with :
75- token : ${{ secrets.CODECOV_TOKEN }}
63+ upload_coverage :
64+ if : always()
65+ needs : [test]
66+ uses : pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
67+ secrets :
68+ codecov_token : ${{ secrets.CODECOV_TOKEN }}
7669
7770 test-pyinstaller-build :
7871 name : Test pyinstaller
7972 runs-on : ubuntu-latest
8073 steps :
81- - uses : actions/checkout@v4
82- - name : Set up Python
83- uses : actions/setup-python@v5
84- with :
85- python-version : 3.12
86- - name : Install package and dev dependencies
87- run : |
88- python -m pip install --upgrade pip
89- pip install .
90- pip install pytest pyinstaller
91- - name : Unit tests
92- run : pytest -v --pyargs cmap.__pyinstaller
93-
94- deploy :
95- name : Deploy
74+ - uses : actions/checkout@v4
75+ - name : Set up Python
76+ uses : actions/setup-python@v5
77+ with :
78+ python-version : 3.12
79+ - name : Install package and dev dependencies
80+ run : |
81+ python -m pip install --upgrade pip
82+ pip install .
83+ pip install pytest pyinstaller
84+ - name : Unit tests
85+ run : pytest -v --pyargs cmap.__pyinstaller
86+
87+ build-and-inspect-package :
88+ name : Build & inspect package.
9689 needs : test
97- if : success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
9890 runs-on : ubuntu-latest
91+ steps :
92+ - uses : actions/checkout@v4
93+ with :
94+ fetch-depth : 0
95+ - uses : hynek/build-and-inspect-python-package@v2
9996
97+ upload-to-pypi :
98+ name : Upload package to PyPI
99+ needs : build-and-inspect-package
100+ if : success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
101+ runs-on : ubuntu-latest
100102 permissions :
101103 id-token : write
102104 contents : write
103105
104106 steps :
105- - uses : actions/checkout@v4
107+ - name : Download built artifact to dist/
108+ uses : actions/download-artifact@v4
106109 with :
107- fetch-depth : 0
108-
109- - name : Set up Python
110- uses : actions/setup-python@v5
111- with :
112- python-version : " 3.x"
113-
114- - name : 👷 Build
115- run : |
116- python -m pip install build
117- python -m build
118-
110+ name : Packages
111+ path : dist
119112 - name : 🚢 Publish to PyPI
120113 uses : pypa/gh-action-pypi-publish@release/v1
121-
122114 - uses : softprops/action-gh-release@v2
123115 with :
124116 generate_release_notes : true
125- files : " ./dist/*"
117+ files : ' ./dist/*'
0 commit comments