From 146cd71281abe7edded9c3bf465e3aab7633a5a6 Mon Sep 17 00:00:00 2001 From: emdee Date: Thu, 17 Nov 2022 08:51:30 +0000 Subject: [PATCH] add .github/workflows/test.yml --- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++++++++++ tests/conftest.py | 16 ++++--------- 2 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..dd95a4a --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index 3e04987..2d4eff1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,8 @@ -# © 2018 Gerard Marull-Paretas -# © 2014 Mark Harviston -# © 2014 Arve Knudsen +# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*- + +# (c) 2018 Gerard Marull-Paretas +# (c) 2014 Mark Harviston +# (c) 2014 Arve Knudsen # BSD License # phantompy test - just test qasync for now @@ -9,18 +11,10 @@ import os import logging from pytest import fixture - logging.basicConfig( 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") def application(): from phantompy.qasync_phantompy import QApplication