mirror of
https://github.com/db9979/uconsole_asw_game.git
synced 2026-12-06 04:44:18 +01:00
135 lines
3.7 KiB
YAML
135 lines
3.7 KiB
YAML
# Runs the behavioural contract on every push to main and every pull request:
|
|
# the full pytest suite (with headless Chromium for the Remote Crew browser
|
|
# tests), the generated-file checks, the calibration against 1.0.0 and the
|
|
# full smoke test (AGENTS.md "Build and verification"). Headless CI is not
|
|
# hardware acceptance; see docs/hardware-acceptance.md for the uConsole.
|
|
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: tests-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
checks:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install -e ".[dev]"
|
|
|
|
- name: Generated files are current
|
|
run: |
|
|
python tools/gen_contacts.py --check
|
|
python tools/build_manual.py --check
|
|
python tools/gen_web_schema.py --check
|
|
python tools/changelog_notes.py --check
|
|
|
|
- name: Calibration against 1.0.0
|
|
run: python tools/calibrate.py --check
|
|
|
|
- name: Smoke test
|
|
run: python tools/smoke_full.py
|
|
|
|
pytest:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 70
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install -e ".[dev]"
|
|
|
|
- name: Put Chromium on PATH
|
|
# The browser tests look for "chromium"; the runner ships Chrome.
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/bin"
|
|
ln -s "$(command -v google-chrome)" "$RUNNER_TEMP/bin/chromium"
|
|
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: pytest
|
|
run: python -m pytest -q -m "not browser"
|
|
|
|
pytest-browser:
|
|
# Its own job, so the Chromium tests run beside the main suite.
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install -e ".[dev]"
|
|
|
|
- name: Put Chromium on PATH
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/bin"
|
|
ln -s "$(command -v google-chrome)" "$RUNNER_TEMP/bin/chromium"
|
|
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: pytest (browser tests)
|
|
# The Chromium probes race a live host or run under virtual time;
|
|
# two workers keep the runner from starving either side. conftest.py
|
|
# marks every module that drives Chromium as "browser".
|
|
run: python -m pytest -q -n 2 -m browser
|
|
|
|
pytest-newer-python:
|
|
# Newer uConsole systems ship Python 3.13; the game must run there too.
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 70
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install -e ".[dev]"
|
|
|
|
- name: pytest
|
|
run: python -m pytest -q -m "not browser"
|
|
|
|
pytest-windows:
|
|
# The Windows program runs the same code; the browser tests stay on Linux.
|
|
runs-on: windows-latest
|
|
timeout-minutes: 70
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: pip
|
|
|
|
- name: Install dependencies
|
|
run: python -m pip install -e ".[dev]"
|
|
|
|
- name: pytest
|
|
run: python -m pytest -q -m "not browser and not slow"
|