New asyncWrap helper to execute blocking calls on the native Qt event… #194
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: | |
| - master | |
| - develop | |
| pull_request: | |
| branches: | |
| - "**" | |
| concurrency: | |
| group: tests-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| tests: | |
| name: ${{ matrix.os }} / ${{ matrix.python-version }} / ${{ matrix.qt-version }} | |
| runs-on: ${{ matrix.image }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu, windows, macos-x86_64, macos-arm64] | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
| qt-version: ["pyside2", "pyside6", "pyqt5", "pyqt6"] | |
| include: | |
| - os: ubuntu | |
| image: ubuntu-24.04 | |
| - os: windows | |
| image: windows-2022 | |
| - os: macos-x86_64 | |
| image: macos-13 | |
| - os: macos-arm64 | |
| image: macos-14 | |
| exclude: | |
| # pyside2 does not publish arm64 packages | |
| - os: macos-arm64 | |
| qt-version: pyside2 | |
| # pyside2 requires python <3.11 | |
| - python-version: "3.11" | |
| qt-version: pyside2 | |
| - python-version: "3.12" | |
| qt-version: pyside2 | |
| - python-version: "3.13" | |
| qt-version: pyside2 | |
| # pyside6 and pyqt6 require python >=3.9 | |
| - python-version: "3.8" | |
| qt-version: pyside6 | |
| - python-version: "3.8" | |
| qt-version: pyqt6 | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Get full Python version | |
| id: full-python-version | |
| run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
| - name: Bootstrap poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.4 python - -y | |
| - name: Update Path | |
| if: ${{ matrix.os != 'windows' }} | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Update Path for Windows | |
| if: ${{ matrix.os == 'windows' }} | |
| run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH | |
| - name: Enable long paths on Windows | |
| if: ${{ matrix.os == 'windows' }} | |
| run: git config --system core.longpaths true | |
| - name: Configure poetry | |
| run: poetry config virtualenvs.in-project true | |
| - name: Setup cache | |
| uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: .venv | |
| key: venv-${{ runner.os }}-${{ matrix.qt-version }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
| - name: Valdate cache | |
| if: steps.cache.outputs.cache-hit == 'true' | |
| run: | | |
| # `timeout` is not available on macos, so we define a custom function. | |
| [ "$(command -v timeout)" ] || function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } | |
| # Using `timeout` is a safeguard against the Poetry command hanging for some reason. | |
| timeout 10s poetry run pip --version || rm -rf .venv | |
| - name: Check lock file | |
| run: poetry check --lock | |
| - name: Install dependencies | |
| run: poetry install --with github-actions | |
| # - name: Run mypy | |
| # run: poetry run mypy | |
| - name: Install Qt | |
| run: poetry run pip install --ignore-installed ${{ matrix.qt-version }} | |
| - name: Install libxcb dependencies | |
| if: ${{ matrix.os == 'ubuntu' }} | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get -qq install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl-dev | |
| - name: Run pytest | |
| uses: coactions/setup-xvfb@v1 | |
| env: | |
| QT_API: ${{ matrix.qt-version }} | |
| with: | |
| run: poetry run pytest --cov qasync -v |