on: [push, pull_request] name: Static Analysis jobs: syntax-compat: name: Syntax Compatibility (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: matrix: python-version: ["3.10"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Check syntax compatibility run: python -m compileall -q lutris/ mypy-checker: name: Mypy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Print current dir run: pwd - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install Ubuntu dependencies run: | sudo apt update sudo apt-get install libdbus-1-dev pkg-config libgirepository-2.0-dev python3-gi-cairo libcairo2-dev - name: Install Python dependencies run: | python -m pip install --upgrade pip make req-python make dev - name: Run mypy analysis run: | mypy --version mypy . --python-version 3.10 po-checker: name: Translation files runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install gettext run: sudo apt-get install -y gettext - name: Validate .po files run: | for f in po/*.po; do msgfmt --check "$f" -o /dev/null done annotation-compat: name: Annotation Compatibility runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - name: Check for unquoted TYPE_CHECKING annotations run: python utils/check_annotations.py ruff-checker: name: Ruff runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install Ubuntu dependencies run: | sudo apt update sudo apt-get install libdbus-1-dev pkg-config libgirepository-2.0-dev python3-gi-cairo libcairo2-dev - name: Install Python dependencies run: | python -m pip install --upgrade pip make dev - name: Ruff version run: ruff --version - name: Check code style run: ruff check . - name: Check format run: ruff format . --check unit-test: name: UnitTest runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install Ubuntu dependencies run: | sudo apt update sudo apt-get install libdbus-1-dev pkg-config libgirepository-2.0-dev python3-gi-cairo libcairo2-dev libgtk-3-dev libgdk-pixbuf-2.0-dev libgnome-desktop-3-dev libwebkit2gtk-4.1-dev - name: Install Python dependencies run: | python -m pip install --upgrade pip python -m venv .venv . .venv/bin/activate make req-python make dev - name: Run Unit Test run: | . .venv/bin/activate nose2 --exclude-ci