CI #1116
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: {} | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * 0" # run once a week | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-manifest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx run check-manifest | |
| test: | |
| name: Test ${{ matrix.qt }} ${{ matrix.os }} py${{ matrix.python-version }} mypyc-${{ matrix.compile }} ${{ matrix.pydantic }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| HATCH_BUILD_HOOKS_ENABLE: ${{ matrix.compile }} | |
| UV_NO_SYNC: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.11", "3.13"] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| compile: ["1", "0"] | |
| qt: [""] | |
| pydantic: [""] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.10" | |
| compile: "1" | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| compile: "1" | |
| # pydantic versions | |
| - os: ubuntu-latest | |
| python-version: "3.10" | |
| pydantic: "pydantic==1.10" | |
| compile: "1" | |
| - os: ubuntu-latest | |
| python-version: "3.9" | |
| pydantic: "pydantic==1.10" | |
| compile: "0" | |
| # qt stuff | |
| - os: macos-latest | |
| python-version: "3.10" | |
| qt: "PyQt5" | |
| compile: "0" | |
| - os: windows-latest | |
| python-version: "3.11" | |
| qt: "PySide6" | |
| compile: "1" | |
| - os: ubuntu-latest | |
| python-version: "3.13" | |
| qt: "PyQt6" | |
| compile: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Install the project | |
| run: | | |
| uv sync --no-dev --group test | |
| uv run python -c "import psygnal; print('compiled:', psygnal._compiled)" | |
| - if: matrix.qt != '' | |
| uses: pyvista/setup-headless-display-action@v4 | |
| with: | |
| qt: true | |
| - if: matrix.qt != '' | |
| run: | | |
| uv sync --no-dev --group testqt | |
| uv pip install ${{ matrix.qt }} | |
| - if: matrix.pydantic != '' | |
| name: downgrade pydantic | |
| run: uv pip install ${{ matrix.pydantic }} | |
| - name: Test | |
| shell: bash | |
| run: uv run coverage run -p -m pytest -v | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: covreport-${{ matrix.os }}-py${{ matrix.python-version }}-mypyc${{ matrix.compile }}-${{ matrix.qt }}-${{ matrix.pydantic }} | |
| path: ./.coverage* | |
| include-hidden-files: true | |
| upload_coverage: | |
| if: always() | |
| needs: [test] | |
| uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2 | |
| secrets: inherit | |
| test-magicgui: | |
| uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v2 | |
| with: | |
| dependency-repo: pyapp-kit/magicgui | |
| dependency-extras: "test" | |
| qt: "pyside2" | |
| python-version: "3.10" | |
| typing: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: install | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -e . | |
| python -m pip install pytest pytest-mypy-plugins | |
| - name: test | |
| run: pytest typesafety --mypy-only-local-stub --color=yes | |
| benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install the project | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install . --group test-codspeed | |
| python -c "import psygnal; print('compiled:', psygnal._compiled)" | |
| env: | |
| HATCH_BUILD_HOOKS_ENABLE: "1" | |
| - name: Run benchmarks | |
| uses: CodSpeedHQ/action@v3 | |
| with: | |
| run: pytest --codspeed -v |