-
Notifications
You must be signed in to change notification settings - Fork 9
81 lines (80 loc) · 3.46 KB
/
pytest.yml
File metadata and controls
81 lines (80 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: pytest
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- '**.py'
push:
branches: [main]
paths:
- '**.py'
workflow_dispatch:
jobs:
pytest:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ["3.10", "3.11", "3.12", "3.13"]
name: ${{ matrix.os }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install system OpenGL/EGL libraries (Ubuntu)
if: matrix.os == 'ubuntu'
# libegl1: EGL headless rendering (preferred, no display needed)
# libgl1: OpenGL implementation pulled in by PyOpenGL
# libfontconfig1: font discovery used by the caption renderer
run: sudo apt-get install -y --no-install-recommends libegl1 libgl1 libfontconfig1
- name: Install Mesa software OpenGL (Windows)
if: matrix.os == 'windows'
# mesa-dist-win (MSVC build) provides software OpenGL 3.3 Core via
# llvmpipe — compatible with Python's MSVC runtime.
# All x64 DLLs are extracted to C:\mesa and prepended to PATH so that
# Windows DLL search finds opengl32.dll and all its Mesa dependencies.
shell: pwsh
run: |
$url = "https://github.com/pal1000/mesa-dist-win/releases/download/24.3.4/mesa3d-24.3.4-release-msvc.7z"
$archive = "$env:TEMP\mesa.7z"
Invoke-WebRequest -Uri $url -OutFile $archive
New-Item -ItemType Directory -Force -Path "C:\mesa" | Out-Null
7z e $archive -o"C:\mesa" "x64\*" -y
echo "C:\mesa" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Rendering strategy per platform:
# Ubuntu: no display → GLFW fails → EGL
# CI runners have no GPU device so EGL uses CPU software
# rendering (llvmpipe) via EGL_MESA_device_software
# macOS: rendering tests SKIPPED — NSGL requires a real display
# connection even for invisible windows; CI runners have none
# Windows: Mesa opengl32.dll (MSVC build) on PATH → GLFW invisible
# window with Core Profile + FORWARD_COMPAT via llvmpipe
- name: Install package
run: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off .[test]
- name: Display system information
run: whippersnappy-sys_info --developer
- name: Run pytest
run: pytest tests --cov=whippersnappy --cov-report=xml --cov-config=pyproject.toml
- name: Upload to codecov
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && github.repository == 'Deep-MI/WhipperSnapPy' }}
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
#fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
#slug: deep-mi/WhipperSnapPy