Skip to content

CI

CI #18

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest, macos-latest]
env:
# Headless QtWebEngine; the sandbox is off in CI only (Ubuntu's AppArmor
# user-namespace restriction), never in the shipped app
QT_QPA_PLATFORM: offscreen
QTWEBENGINE_DISABLE_SANDBOX: "1"
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: System libraries (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends xvfb libportaudio2 libasound2t64 \
libegl1 libgl1 libopengl0 libgbm1 libnss3 libxkbcommon0 libxkbcommon-x11-0 \
libxcomposite1 libxdamage1 libxrandr2 libxtst6 libxkbfile1 libxshmfence1 \
libxcb-cursor0 libdbus-1-3 libfontconfig1
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
# tkinter needs a display on Linux: xvfb. The web tests stay offscreen.
- name: Tests (Linux)
if: runner.os == 'Linux'
timeout-minutes: 10
run: xvfb-run -a python -m pytest tests -v --ignore=tests/web
- name: Tests
if: runner.os != 'Linux'
timeout-minutes: 10
run: python -m pytest tests -v --ignore=tests/web
- name: Web front-end tests
timeout-minutes: 8
run: python -m pytest tests/web -v
# Headless start-up of both interfaces (no audio device is fine)
- name: Start-up, web interface
run: python -m pythonic --ui web --quit-after 5
- name: Start-up, tkinter interface (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a python -m pythonic --ui tk --quit-after 5
- name: Start-up, tkinter interface
if: runner.os != 'Linux'
run: python -m pythonic --ui tk --quit-after 5