Files
openttd-client/.github/workflows/ci.yml
Renovate Bot 71bef5a8a2
All checks were successful
Continuous Integration / lint-and-security (pull_request) Successful in 1m55s
Continuous Integration / tests-and-coverage (pull_request) Successful in 24s
Update actions/setup-python action to v7
2026-07-21 02:22:10 +00:00

61 lines
1.8 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
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 -m "not e2e" tests/
- name: Verify Public API E2E Call Constraints
env:
PYTHONPATH: lib
run: |
python check_public_calls.py