-
Notifications
You must be signed in to change notification settings - Fork 50
146 lines (138 loc) · 4.17 KB
/
test_and_deploy.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main]
tags: [v*]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # run once a day
jobs:
test:
name: Test
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
qt: ${{ matrix.qt }}
pip-install-pre-release: ${{ github.event_name == 'schedule' }}
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
qt: [pyqt6, pyside6]
include:
- python-version: "3.8"
os: ubuntu-latest
qt: pyqt5
- python-version: "3.8"
os: macos-13
qt: pyside2
- python-version: "3.8"
os: windows-latest
qt: pyqt5
- python-version: "3.9"
os: macos-13
qt: pyqt5
- python-version: "3.9"
os: ubuntu-latest
qt: pyside2
- python-version: "3.10"
os: ubuntu-latest
qt: pyside2
- python-version: "3.12"
os: ubuntu-latest
qt: pyqt6
- python-version: "3.12"
os: ubuntu-latest
qt: pyside6
test-min-reqs:
name: Test min reqs
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ubuntu-latest
python-version: ${{ matrix.python-version }}
qt: pyqt5
pip-install-min-reqs: true
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
test-pydantic1:
name: Test pydantic 1
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ubuntu-latest
python-version: 3.11
qt: pyqt6
pip-post-installs: '"pydantic<2"'
coverage-upload: artifact
upload_coverage:
if: always()
needs: [test, test-min-reqs, test-pydantic1]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets: inherit
test-dependents:
uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v2
with:
dependency-repo: ${{ matrix.package }}
dependency-ref: ${{ matrix.package-version }}
dependency-extras: ${{ matrix.package-extras || 'testing' }}
host-extras: "testing"
qt: pyqt5
python-version: "3.10"
post-install-cmd: "python -m pip install pytest-pretty lxml_html_clean" # just for napari
pytest-args: ${{ matrix.pytest-args }}
strategy:
fail-fast: false
matrix:
include:
- package: napari/napari
pytest-args: napari/_tests/test_magicgui.py
- package: napari/napari
package-version: "v0.4.19.post1"
pytest-args: napari/_tests/test_magicgui.py
- package: hanjinliu/magic-class
- package: stardist/stardist-napari
package-extras: test
pytest-args: stardist_napari
- package: 4DNucleome/PartSeg
package-extras: test
pytest-args: package/tests/test_PartSeg/test_napari_widgets.py
deploy:
needs: test
runs-on: ubuntu-latest
if: ${{ github.repository == 'pyapp-kit/magicgui' && contains(github.ref, 'tags') }}
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm wheel twine build
- name: Build
run: |
git tag
python -m build
twine check dist/*
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
body_path: ${{ github.workspace }}/CHANGELOG.md
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1