Skip to content

Bump ruff from 0.15.13 to 0.15.14 #971

Bump ruff from 0.15.13 to 0.15.14

Bump ruff from 0.15.13 to 0.15.14 #971

Workflow file for this run

name: Tests
on:
push:
paths:
- '**.py'
- 'pyproject.toml'
- 'uv.lock'
pull_request:
paths:
- '**.py'
- 'pyproject.toml'
- 'uv.lock'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies (bare package, no optional extras)
run: uv sync --dev
- name: Install Xvfb and GL libs (Linux only - needed for sprite/display tests)
if: matrix.os == 'ubuntu-latest'
env:
DISPLAY: ':99.0'
run: |
sudo apt-get update -y
sudo apt-get install -y xvfb x11-utils libxkbcommon-x11-0 libgl1 libglu1-mesa mesa-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
- name: Run unit tests (Linux - excludes tests requiring optional dependencies)
if: matrix.os == 'ubuntu-latest'
env:
DISPLAY: ':99.0'
LIBGL_ALWAYS_SOFTWARE: '1'
run: uv run pytest tests/ -v --tb=short --ignore=tests/integration
- name: Run unit tests (Windows/macOS - excludes tests requiring optional dependencies)
if: matrix.os != 'ubuntu-latest'
run: uv run pytest tests/ -v --tb=short --ignore=tests/integration
- name: Install statemachine extra for examples (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: uv sync --extra statemachine --dev
- name: Smoke test examples (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
env:
DISPLAY: ':99.0'
LIBGL_ALWAYS_SOFTWARE: '1'
run: |
for f in examples/*.py; do
echo "Running $f for 5s"
set +e
timeout 5s uv run python "$f"
rc=$?
set -e
if [ $rc -eq 124 ]; then
echo "OK: $f ran and timed out after 5s as expected"
elif [ $rc -eq 0 ]; then
echo "OK: $f exited cleanly within 5s"
else
echo "FAIL: $f exited with $rc"
exit $rc
fi
done
- name: Run tests with coverage (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
env:
DISPLAY: ':99.0'
LIBGL_ALWAYS_SOFTWARE: '1'
run: CI=true uv run pytest tests/ --cov=arcadeactions --cov-fail-under=90 --cov-report=xml --cov-report=json:coverage.json --cov-report=term-missing
- name: Report diff coverage (Linux Python 3.11 PRs, informational)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && github.event_name == 'pull_request'
run: uv run diff-cover coverage.xml --compare-branch=origin/${{ github.base_ref }}
- name: Collect Radon metrics (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: |
uv run radon raw -j arcadeactions > radon_raw.json
uv run radon cc -j arcadeactions > radon_cc.json
- name: Generate refactoring priority report (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: |
uv run python tools/refactor_priority.py \
--radon-raw radon_raw.json \
--radon-cc radon_cc.json \
--coverage-json coverage.json \
--min-sloc 100 \
--top 30 \
--output refactor-priority-report.md
- name: Upload refactoring priority report (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: actions/upload-artifact@v7
with:
name: refactor-priority-report
path: refactor-priority-report.md
retention-days: 30
- name: Upload coverage to Codecov (Linux Python 3.11 only)
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
test-optional-deps:
name: Tests requiring optional dependencies
runs-on: ubuntu-latest
# Note: tests/integration/ contains tests that require optional dependencies
# (like python-statemachine). These are excluded from the main test run
# because they need extras installed.
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies with statemachine extra
run: uv sync --extra statemachine --dev
- name: Install Xvfb and GL libs (needed for sprite/display tests)
env:
DISPLAY: ':99.0'
run: |
sudo apt-get update -y
sudo apt-get install -y xvfb x11-utils libxkbcommon-x11-0 libgl1 libglu1-mesa mesa-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
- name: Run tests requiring optional dependencies
env:
DISPLAY: ':99.0'
LIBGL_ALWAYS_SOFTWARE: '1'
run: uv run pytest tests/integration/ -v --tb=short
- name: Run full test suite to ensure no regressions
env:
DISPLAY: ':99.0'
LIBGL_ALWAYS_SOFTWARE: '1'
run: uv run pytest tests/ -v --tb=short