Skip to content

v0.3.41: SpriteRenderer SRP refactoring + code quality fixes + doc sync #61

v0.3.41: SpriteRenderer SRP refactoring + code quality fixes + doc sync

v0.3.41: SpriteRenderer SRP refactoring + code quality fixes + doc sync #61

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run ruff linter
run: ruff check .
- name: Run ruff formatter
run: ruff format --check .
- name: Run mypy type checking
run: mypy src/
- name: Security scan
run: |
pip install bandit==1.9.0
bandit -r src/ -ll
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run tests with coverage
env:
SDL_VIDEODRIVER: dummy
run: |
pytest tests/ \
--cov=src/pycc2 \
--cov-report=xml \
--cov-report=html \
--junitxml=junit.xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v7
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Run performance benchmarks
run: SDL_VIDEODRIVER=dummy python -m pytest tests/benchmark/test_perf_benchmark.py -v
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.python-version }}
path: |
junit.xml
htmlcov/
docker-build:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' && github.base_ref == 'main'
steps:
- uses: actions/checkout@v6
- name: Build Docker image
run: docker build -t pycc2-test .
- name: Run tests in Docker
run: docker run --rm pycc2-test