Skip to content

Python package

Python package #96

Workflow file for this run

# For more information see:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 5 1 */3 *'
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-20.04"
- "ubuntu-22.04"
- "macos-11"
- "macos-12"
- "windows-2019"
- "windows-2022"
python-version:
- "3.9"
- "3.10"
include:
- python-version: "3.8"
os: ubuntu-22.04
- python-version: "3.11"
os: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y xvfb scrot maim imagemagick x11-utils python3-gi gir1.2-gtk-3.0 python3-wxgtk4.0 python3-pyqt5
sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev libportmidi-dev libportmidi-dev
- name: Install ubuntu-20.04 dependencies
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get install -y python3-pyside2.qtwidgets
#wget http://ppa.launchpad.net/jan-simon/pqiv/ubuntu/pool/main/p/pqiv/pqiv_2.10.3-0~4~ubuntu20.04.1_amd64.deb
#sudo apt install ./*.deb
# - name: Install MacOS dependencies
# if: startsWith(matrix.os, 'macos')
# run: |
# #brew install --cask xquartz
# #brew install wxmac pyqt pyside
# #brew install imagemagick pqiv
- name: Install Win dependencies
if: startsWith(matrix.os, 'win')
run: |
# choco install fsviewer -y
choco install imagemagick -y
choco install wxpython -y
choco install gtk-runtime -y
choco install pyqt4 -y
choco install pyqt5 -y
- name: pip install
run: |
pip install wheel
python -m pip install .
pip install -r requirements-test.txt
- name: print versions
run: |
python -m pyscreenshot.check.versions
- name: speedtest
run: |
python -m pyscreenshot.check.speedtest
python -m pyscreenshot.check.speedtest --childprocess 0
- name: speedtest --virtual-display
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pyscreenshot.check.speedtest --virtual-display
python -m pyscreenshot.check.speedtest --virtual-display --childprocess 0
- name: Test with pytest
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
run: |
cd tests
pytest -v .
- name: Test with pytest on xvfb
if: startsWith(matrix.os, 'ubuntu')
run: |
cd tests
xvfb-run -s "-br -screen 0 900x800x24" pytest -v .
- name: Archive production artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: testout-${{ matrix.os }}-${{ matrix.python-version }}
path: |
tests/testout
# - name: Lint
# if: matrix.os == 'ubuntu-20.04'
# run: |
# ./lint.sh