Skip to content

tox & stuff

tox & stuff #35

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches: [ master, PySide6 ]
pull_request:
branches: [ master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --per-file-ignores="six.py:F821"
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
working-directory: ./PythonEditor
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
qt-binding: ["PySide2", "PySide6"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libgl1 libxkbcommon-x11-0 libxrender1 libx11-xcb1 libxcb-cursor0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ "${{ matrix.qt-binding }}" = "PySide6" ]; then
pip install -r requirements-pyside6.txt
else
pip install -r requirements.txt
fi
- name: Test with pytest (headless)
env:
QT_QPA_PLATFORM: offscreen
QT_PREFERRED_BINDING: ${{ matrix.qt-binding }}
PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1"
run: |
python -m pytest -vv -m "gui"