chore: update schema (#301) #1018
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: tests | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "v2" | |
| tags: | |
| - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check_manifest: | |
| name: check-manifest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - run: uvx check-manifest | |
| test: | |
| name: ${{ matrix.platform }} (${{ matrix.python-version }}) [${{ matrix.resolution }}] | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| UV_PRERELEASE: ${{ github.event_name == 'schedule' && 'allow' || 'if-necessary-or-explicit' }} | |
| PYTEST_ADDOPTS: ${{ matrix.resolution == 'lowest-direct' && '-W ignore' || '' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| platform: [ubuntu-latest, macos-latest, windows-latest] | |
| resolution: ["highest", "lowest-direct"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: 🐍 Set up Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Install Dependencies | |
| run: uv sync --no-dev --group test | |
| env: | |
| UV_RESOLUTION: ${{ matrix.resolution }} | |
| - name: 🧪 Run Tests | |
| run: uv run --no-sync coverage run -p -m pytest -v | |
| - name: retest without lxml or xmlschema | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| uv pip uninstall lxml xmlschema | |
| uv run --no-sync pytest --cov --cov-report=xml --cov-append | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: covreport-${{ matrix.platform }}-py${{ matrix.python-version }}-${{ matrix.resolution }} | |
| path: ./.coverage* | |
| include-hidden-files: true | |
| upload_coverage: | |
| if: always() | |
| needs: [test] | |
| uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2 | |
| secrets: | |
| codecov_token: ${{ secrets.CODECOV_TOKEN }} | |
| test-widget: | |
| name: test-widget | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| backend: ["PyQt5", "PySide6", "PyQt6"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: "3.11" | |
| - uses: tlambert03/setup-qt-libs@v1 | |
| - name: Install | |
| run: | | |
| uv sync --group test-qt | |
| uv pip install "${{ matrix.backend }}" | |
| - name: Test | |
| uses: aganders3/headless-gui@v2 | |
| with: | |
| run: uv run --no-sync pytest tests/test_widget.py | |
| test-build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install | |
| run: uv sync --group test --extra build | |
| - name: Build | |
| run: uv run --no-sync pytest --cov --cov-report=xml --cov-append -k test_autogen | |
| env: | |
| TEST_AUTOGEN: "1" | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-types: | |
| name: Typesafety | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --group test | |
| - name: Test | |
| run: uv run --no-sync pytest typesafety -v | |
| benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: "3.11" | |
| - name: install | |
| run: uv sync --group test | |
| - name: Run benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| run: uv run pytest --codspeed -v --color=yes | |
| mode: instrumentation | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| needs: [test, check_manifest] | |
| if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Build | |
| run: uv build | |
| - name: Publish PyPI Package | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TWINE_API_KEY }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: "dist/*" |