improving qt tests #115
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: Test with flake8 and pytest (cudmore) | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [master] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: setup.py | |
# these libraries enable testing on Qt on linux | |
- name: Install Linux dependencies | |
uses: tlambert03/setup-qt-libs@v1 | |
# workaround for testing Qt on linux | |
- name: Workaround for testing Qt on linux | |
if: runner.os == 'Linux' | |
run: | | |
sudo mkdir /usr/bin/platforms | |
sudo ln -s /our/local/libqxcb.so /usr/bin/platforms/libqxcb.so | |
- name: Install dependencies | |
run: | | |
# pip install -e '.[gui]' | |
pip install '.[test]' | |
- name: Run flake8 | |
run: | | |
flake8 ./sanpy --count --select=E9,F63,F7,F82 --show-source --statistics | |
- name: Test and generate coverage report | |
run: | | |
# ignore /interface tests, they are running out of memory on github? | |
pytest --cov=./tests --cov-report=xml --ignore=./tests/interface ./tests | |
pytest -s --cov=./tests --cov-report=xml ./tests/interface | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |