add .github/workflows/test.yml

This commit is contained in:
emdee 2022-11-17 08:51:30 +00:00
parent 81a5e66b60
commit 146cd71281
2 changed files with 52 additions and 11 deletions

47
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: test
on: [push]
jobs:
ci:
name: Python-${{ matrix.python }} ${{ matrix.qt.qt_api }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qt:
- package: PyQt5
qt_api: "pyqt5"
- package: PyQt6
qt_api: "pyqt6"
- package: PySide2
qt_api: "pyside2"
- package: PySide6
qt_api: "pyside6"
python: [3.6, 3.7, 3.8, 3.9]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Install dependencies
run: |
pipenv install --dev
pipenv run pip install ${{ matrix.qt.package }} pytest
- name: Install Libxcb dependencies
run: |
sudo apt-get update
sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
- name: Run headless test
uses: GabrielBB/xvfb-action@v1
env:
QT_API: ${{ matrix.qt.qt_api }}
with:
run: pipenv run py.test --forked -v

View File

@ -1,6 +1,8 @@
# © 2018 Gerard Marull-Paretas <gerard@teslabs.com> # -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
# © 2014 Mark Harviston <mark.harviston@gmail.com>
# © 2014 Arve Knudsen <arve.knudsen@gmail.com> # (c) 2018 Gerard Marull-Paretas <gerard@teslabs.com>
# (c) 2014 Mark Harviston <mark.harviston@gmail.com>
# (c) 2014 Arve Knudsen <arve.knudsen@gmail.com>
# BSD License # BSD License
# phantompy test - just test qasync for now # phantompy test - just test qasync for now
@ -9,18 +11,10 @@ import os
import logging import logging
from pytest import fixture from pytest import fixture
logging.basicConfig( logging.basicConfig(
level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s" level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s"
) )
if os.name == "nt":
collect_ignore = ["qasync/_unix.py"]
else:
collect_ignore = ["qasync/_windows.py"]
@fixture(scope="session") @fixture(scope="session")
def application(): def application():
from phantompy.qasync_phantompy import QApplication from phantompy.qasync_phantompy import QApplication