-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.44 KB
/
test.yml
File metadata and controls
51 lines (48 loc) · 1.44 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
name: Test
on:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
check-ruff:
# fail it if doesn't conform to ruff formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/ruff-action@v3
with:
args: "format --check --diff"
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Enable caching
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install OpenGL dependencies (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libglu1-mesa libgl1-mesa-dev
- name: Install Xvfb (Linux only)
if: runner.os == 'Linux'
run: sudo apt-get install -y xvfb
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Run tests with virtual display (Linux only)
if: runner.os == 'Linux'
run: xvfb-run -a .venv/bin/python -m pytest
- name: Run tests (non-Linux)
if: runner.os != 'Linux'
run: uv run pytest tests