name: CI # Actions minutes are the cost here: from 1 to 3 October 2026 this workflow # used 3,737 minutes in 29 runs, because the suite takes 60-79 minutes on # CPython and 8-10 on PyPy. So: PyPy only, on pushes to main and on pull # requests (a pushed branch with a PR open no longer runs twice), a newer run # on the same ref cancels the older one, and the CPython interpreters run only # when started by hand (Actions tab, "Run workflow"). on: push: branches: [main] pull_request: workflow_dispatch: concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: test: runs-on: ubuntu-latest # PyPy takes about 10 minutes; a manual CPython run about 80. timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && 120 || 30 }} strategy: fail-fast: false matrix: # The floor is the newest Python PyPy supports (docs/handoff-brief.md). # CPython 3.11 and 3.14 only on a manual run: an hour each per push. python-version: ${{ github.event_name == 'workflow_dispatch' && fromJSON('["3.11", "3.14", "pypy3.11"]') || fromJSON('["pypy3.11"]') }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # The four cores are pinned by revision in pyproject.toml; all four repositories # are public, so pip fetches them over plain HTTPS with no key. - run: python -m pip install --upgrade pip - run: python -m pip install -e ".[dev]" # What the two fetch steps below bring in, kept between runs: the pinned files # come from other people's sites (Nemesis's was down on 2026-09-26, and every run # failed until the pins gained Wayback mirrors), so a run that finds them here # does not need any of those sites up. Keyed on both pin files, so a changed pin # starts a fresh cache; fetch_references.py still checks every file's SHA-256. - uses: actions/cache@v4 with: path: | tests/test_roms reference/images reference/src/Nuked-OPN2 reference/src/Nuked-PSG reference/src/YM2608-LLE key: fetched-${{ hashFiles('scripts/pinned_files.json', 'scripts/pinned_repos.json') }} restore-keys: fetched- # The judges of milestones 2 and 3: Nemesis's captures, VDPFIFOTesting, his # sprite masking ROM and the two photographs of his MD1600 running it, and MoD's # gen_test_z80_bus, all fetched at their pinned SHA-256 (never committed). # Milestone 1 needs MAME and the commercial romset and runs locally # (pytest -m slow). - run: | python scripts/fetch_references.py --no-repos \ --only tests/test_roms/nemesis/ \ --only tests/test_roms/mask-of-destiny/ \ --only reference/images/ # Milestone 4's judges are die-derived models, which have to be built and run: # three small source trees at their pinned revisions, then one gcc each # (validation/build_referees.sh). Their binaries are referees, never shipped. # --no-files: this step is for the three trees alone. Without it, it fetched # every pinned file too, and failed from milestone 8 on, when a pin that only # this machine's No-Intro mirror can supply (MD Soft Checker) was added. - run: | python scripts/fetch_references.py --no-files \ --repo Nuked-OPN2 --repo Nuked-PSG --repo YM2608-LLE sh validation/build_referees.sh - run: python -m pytest -q - run: python -m ruff check . - run: python -m ruff format --check .