-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use reusable test workflow (#612)
* ci: try reusable workflow * force * try rename * force * force * rename * add coverage.run * test deps * style(pre-commit.ci): auto fixes [...] * update * inherit secrets * add min-reqs test * shorter name * add min typing extensions * change cov report * update minreqs * bump min typing-ext * ci: don't use matrix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d3f8979
commit 293a561
Showing
2 changed files
with
75 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,58 +6,57 @@ concurrency: | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
branches: [main] | ||
tags: [v*] | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" # run once a day | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.platform }} (${{ matrix.python-version }}) ${{ matrix.backend }} | ||
runs-on: ${{ matrix.platform }} | ||
name: Test | ||
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 | ||
with: | ||
os: ${{ matrix.os }} | ||
python-version: ${{ matrix.python-version }} | ||
qt: ${{ matrix.qt }} | ||
pip-install-pre-release: ${{ github.event_name == 'schedule' }} | ||
report-failures: ${{ github.event_name == 'schedule' }} | ||
secrets: inherit | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
backend: [pyqt5, pyside2] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
qt: [pyqt5, pyside2] | ||
include: | ||
- python-version: "3.10" | ||
platform: ubuntu-latest | ||
backend: pyqt6 | ||
os: ubuntu-latest | ||
qt: pyqt6 | ||
- python-version: "3.10" | ||
platform: ubuntu-latest | ||
backend: pyside6 | ||
os: ubuntu-latest | ||
qt: pyside6 | ||
- python-version: "3.12" | ||
platform: ubuntu-latest | ||
backend: pyqt6 | ||
os: ubuntu-latest | ||
qt: pyqt6 | ||
exclude: | ||
- python-version: "3.11" | ||
backend: pyside2 | ||
|
||
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/[email protected] | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade hatch | ||
|
||
- name: Test | ||
uses: aganders3/headless-gui@v2 | ||
with: | ||
run: hatch -v run +backend=${{ matrix.backend }} test:run | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
qt: pyside2 | ||
|
||
test-min-reqs: | ||
name: Test min reqs | ||
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main | ||
with: | ||
os: ubuntu-latest | ||
python-version: ${{ matrix.python-version }} | ||
qt: pyqt5 | ||
pip-install-min-reqs: true | ||
secrets: inherit | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
|
||
test-pydantic1: | ||
name: Test pydantic1 | ||
|
@@ -85,110 +84,33 @@ jobs: | |
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
test_napari: | ||
name: napari tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: napari/napari | ||
path: napari-from-github | ||
- uses: tlambert03/[email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip pytest-pretty | ||
python -m pip install -e .[testing] | ||
python -m pip install -e ./napari-from-github[pyqt5] | ||
- name: Test napari magicgui | ||
uses: aganders3/headless-gui@v2 | ||
with: | ||
working-directory: napari-from-github | ||
run: pytest -W ignore napari/_tests/test_magicgui.py -v --color=yes | ||
|
||
test_magicclass: | ||
name: magic-class tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: hanjinliu/magic-class | ||
path: magic-class | ||
- uses: tlambert03/[email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -e .[testing,pyqt5] | ||
python -m pip install ./magic-class[testing] | ||
- name: Test magicclass | ||
uses: aganders3/headless-gui@v2 | ||
# magicclass is still in development, don't fail the whole build | ||
# this makes this much less useful... but it's better than nothing? | ||
continue-on-error: true | ||
with: | ||
working-directory: magic-class | ||
run: pytest -v --color=yes | ||
|
||
test_stardist: | ||
name: stardist tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: stardist/stardist-napari | ||
path: stardist-napari | ||
- uses: tlambert03/[email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -e .[testing] | ||
python -m pip install ./stardist-napari[test] | ||
- name: Run stardist tests | ||
uses: aganders3/headless-gui@v2 | ||
with: | ||
working-directory: stardist-napari | ||
run: python -m pytest -v --color=yes -W ignore stardist_napari | ||
env: | ||
STARDIST_NAPARI_NOTHREADS: true | ||
STARDIST_NAPARI_NOPERSIST: true | ||
|
||
test_partseg: | ||
name: partseg tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 4DNucleome/PartSeg | ||
path: PartSeg | ||
- uses: tlambert03/[email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install | ||
run: | | ||
python -m pip install -e .[testing] | ||
python -m pip install ./PartSeg[test,pyqt5] | ||
- name: Run PartSeg tests | ||
uses: aganders3/headless-gui@v2 | ||
with: | ||
working-directory: PartSeg | ||
run: python -m pytest -v --color=yes -W ignore package/tests/test_PartSeg/test_napari_widgets.py | ||
test-dependents: | ||
uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 | ||
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" | ||
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.18" | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters