Files
openttd-client/.github/workflows/ci.yml
kovagoadi cb6849ed55
Some checks failed
Continuous Integration / lint-and-security (push) Successful in 4m14s
Continuous Integration / tests-and-coverage (push) Successful in 33s
CodeQL Analysis / Analyze (python) (push) Failing after 4m17s
Initialized openttd-client repo
2026-06-05 23:18:09 +02:00

55 lines
1.5 KiB
YAML

name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint-and-security:
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 Linting Tools
run: |
python -m pip install --upgrade pip
pip install ruff bandit
- name: Lint with Ruff
run: ruff check .
- name: Security Scan with Bandit
# We ignore B101 (assert) as it's common in tests, and B303 (MD5)
# because OpenTTD protocol REQUIRES MD5 for company passwords.
run: bandit -r lib/ -ll -i -s B101,B303
tests-and-coverage:
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 dependencies
run: |
python -m pip install --upgrade pip
pip install openttd-protocol pymonocypher pytest pytest-asyncio pytest-cov
- name: Run Tests with Strict Coverage
env:
PYTHONPATH: lib
CI: true
# We run tests and fail if coverage is below 100%.
# E2E test is skipped in CI because no local OpenTTD server is available.
run: |
pytest --cov=openttd --cov-report=term-missing --cov-fail-under=100 -k "not test_server_connection_and_join" tests/