Skip to content

Run Python tests

Run Python tests #445

Workflow file for this run

name: Run Python tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 3 * * 5'
jobs:
test:
name: Inkscape ${{ matrix.inkscape-version }} - Python ${{ matrix.python-version }} - OS ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11']
inkscape-version: ['STABLE']
continue-on-error: [false]
include:
- { os: 'windows-latest', python-version: '3.11', inkscape-version: '1.2', continue-on-error: false }
- { os: 'windows-latest', python-version: '3.10', inkscape-version: '1.1', continue-on-error: false }
- { os: 'ubuntu-latest', python-version: '3.12', inkscape-version: 'TRUNK', continue-on-error: true }
- { os: 'ubuntu-latest', python-version: '3.12', inkscape-version: 'inkex', continue-on-error: false }
- { os: 'ubuntu-latest', python-version: '3.9', inkscape-version: 'inkex==1.0.1', continue-on-error: false }
continue-on-error: ${{ matrix.continue-on-error }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 🐧 install Inkscape & umockdev
if: ${{ matrix.os == 'ubuntu-latest' && matrix.inkscape-version != 'TRUNK' && ! startsWith(matrix.inkscape-version, 'inkex') }}
run: |
sudo add-apt-repository ppa:inkscape.dev/stable -y # inkscape STABLE from https://launchpad.net/~inkscape.dev/+archive/ubuntu/stable
sudo apt-get update
sudo apt-get -y install inkscape umockdev
- name: 🐧 install Inkscape TRUNK & umockdev
if: ${{ matrix.os == 'ubuntu-latest' && matrix.inkscape-version == 'TRUNK' }}
run: |
sudo add-apt-repository ppa:inkscape.dev/trunk -y # inkscape DEV from https://launchpad.net/~inkscape.dev/+archive/ubuntu/trunk
sudo apt-get update
sudo apt-get -y install inkscape-trunk umockdev
- name: 🐧 install Inkex standalone & umockdev
if: ${{ matrix.os == 'ubuntu-latest' && startsWith(matrix.inkscape-version, 'inkex') }}
run: |
sudo apt-get -y install umockdev libgirepository1.0-dev
pip install ${{ matrix.inkscape-version }}
- name: 🍏 install Inkscape
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install --cask inkscape
pip install libusb1
- name: 🗖 install Inkscape (fixed)
if: ${{ matrix.os == 'windows-latest' && startsWith(matrix.inkscape-version, '1.') }}
run: |
choco install -y inkscape --version ${{ matrix.inkscape-version }}
- name: 🗖 install Inkscape
if: ${{ matrix.os == 'windows-latest' && matrix.inkscape-version == 'STABLE' }}
run: |
choco install -y inkscape
- name: inkscape version
run: |
inkscape --version || echo "inkscape not found"
- name: install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: test
env:
PYTHONWARNINGS: default
run: |
pytest -s -vv test