Added unit tests devised by Claude #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Arcade 3.0 Cross-Platform Tests | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.12'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
make setup | |
uv python pin ${{ matrix.python-version }} | |
uv add pytest pytest-cov --dev | |
uv sync --all-extras --dev | |
- name: Set up virtual display (Linux only) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y xvfb | |
export DISPLAY=:99 | |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
- name: Set up headless context (Windows only) | |
if: runner.os == 'Windows' | |
run: | | |
echo "import os" > setup_headless.py | |
echo "os.environ['PYGLET_HEADLESS'] = '1'" >> setup_headless.py | |
echo "import pyglet" >> setup_headless.py | |
echo "pyglet.options['shadow_window'] = False" >> setup_headless.py | |
- name: Run tests | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
uv run python -c "import setup_headless" | |
fi | |
uv run pytest tests/ --show-capture=no |