ci(pre-commit.ci): autoupdate (#228) #727
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
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@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: check-manifest | |
run: | | |
pip install check-manifest | |
check-manifest | |
test: | |
name: test ${{ matrix.platform }} (${{ matrix.python-version }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- python-version: "3.7" | |
platform: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# we can't actually do the codegen on python3.7 | |
# (there's an issue with jinja template ordering) | |
# so we build wheel before installing python 3.7 | |
- name: Build Wheel | |
if: matrix.python-version == '3.7' | |
run: | | |
pip install -U pip build | |
python -m build --wheel | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install (3.7) | |
if: matrix.python-version == '3.7' | |
run: | | |
whl=$(ls dist/*.whl) | |
python -m pip install "${whl}[test,dev]" | |
- name: Install | |
if: matrix.python-version != '3.7' | |
run: | | |
python -m pip install -U pip | |
python -m pip install .[test,dev] | |
- name: Test | |
run: pytest --cov --cov-report=xml | |
- name: retest without lxml or xmlschema | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
pip uninstall -y lxml xmlschema | |
pytest --cov --cov-report=xml --cov-append | |
- uses: codecov/codecov-action@v3 | |
if: matrix.python-version != '3.7' | |
test-widget: | |
name: test-widget | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
backend: ["PyQt5", "PySide2", "PySide6", "PyQt6"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- uses: tlambert03/setup-qt-libs@v1 | |
- name: Install | |
run: | | |
python -m pip install -U pip | |
python -m pip install .[test,test-qt] | |
python -m pip install "${{ matrix.backend }}" | |
- name: Test | |
uses: aganders3/headless-gui@v1 | |
with: | |
run: pytest tests/test_widget.py | |
test-pydantic: | |
name: Pydantic compat | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] | |
pydantic: ["v1", "v2", "both"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install | |
run: | | |
python -m pip install -U pip | |
python -m pip install .[test,dev] | |
env: | |
PYDANTIC_SUPPORT: ${{ matrix.pydantic }} | |
- name: Test pydantic1 | |
if: matrix.pydantic == 'v1' || matrix.pydantic == 'both' | |
run: | | |
python -m pip install 'pydantic<2' | |
pytest --cov --cov-report=xml --cov-append | |
- name: Test pydantic2 | |
if: matrix.pydantic == 'v2' || matrix.pydantic == 'both' | |
run: | | |
python -m pip install 'pydantic>=2' | |
pytest --cov --cov-report=xml --cov-append | |
- uses: codecov/codecov-action@v3 | |
test-types: | |
name: Typesafety | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install pytest pytest-mypy-plugins | |
python -m pip install . | |
- name: Test | |
run: pytest typesafety -v | |
benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: install | |
run: python -m pip install .[test] | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v1 | |
with: | |
run: pytest --codspeed -v --color=yes | |
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@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Build | |
run: | | |
pip install -U pip build | |
python -m 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@v1 | |
with: | |
generate_release_notes: true | |
files: "dist/*" |