From 8cc2eead486feb5762b45b139a0932af7ef35365 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 17:47:41 +0200 Subject: [PATCH 01/17] CI: a release workflow, and a nightly one (first: the PC and the browser) release.yml, on a tag vX.Y.Z: the tag against GAME_VERSION, the build and test workflows (now reusable), every machine's files under one naming scheme with SHA256SUMS, a draft release; a dry run on a pull request that changes it. The C64 job makes the .d64 too (Ubuntu's VICE package, c1541). nightly.yml: real emulators under Xvfb, every night, by hand, on a pull request labelled full-test or changing it: the PC in DOSBox-X (replays on VGA, EGA, CGA; keys and sound; matches over the modem and Ethernet), two browsers in Chrome; each test retried once (tools/ci/retry.sh). The ST, the Amiga, the C64, the MZ-800 and cross-play follow. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 8 ++- .github/workflows/nightly.yml | 127 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 107 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 3 +- tools/ci/displays.sh | 7 ++ tools/ci/relay.sh | 7 ++ tools/ci/retry.sh | 7 ++ tools/webpage.py | 5 +- 8 files changed, 267 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/nightly.yml create mode 100644 .github/workflows/release.yml create mode 100755 tools/ci/displays.sh create mode 100755 tools/ci/relay.sh create mode 100755 tools/ci/retry.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d25a82..e8082bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: push: branches: [main] workflow_dispatch: + workflow_call: # the release workflow runs it too defaults: run: @@ -15,7 +16,7 @@ defaults: # command piped into tail would pass) concurrency: - group: build-${{ github.ref }} + group: build-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: @@ -88,8 +89,11 @@ jobs: curl -sSL -o /tmp/llvm-mos.tar.xz \ "https://github.com/llvm-mos/llvm-mos-sdk/releases/download/$LLVM_MOS_VERSION/llvm-mos-linux.tar.xz" tar -xJf /tmp/llvm-mos.tar.xz -C ~ + - name: c1541 (the C64's disk image; VICE's package, no ROMs needed) + if: matrix.dir == 'c64' + run: sudo apt-get update -q && sudo apt-get install -y -q --no-install-recommends vice - name: build - run: LLVM_MOS=~/llvm-mos python3 tools/${{ matrix.script }} + run: C1541=$(command -v c1541 || true) LLVM_MOS=~/llvm-mos python3 tools/${{ matrix.script }} - name: memory budget run: LLVM_MOS=~/llvm-mos python3 tools/check_sizes.py - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..6910be3 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,127 @@ +# The real emulators, in real time, under Xvfb: what the deterministic tests +# (test.yml) cannot show. Every night on main, by hand (Actions, "Run +# workflow"), and on a pull request labelled full-test or one that changes +# this workflow or tools/ci. Not a required check: an emulator in real time +# on a shared machine can stumble, so each test gets a second chance +# (tools/ci/retry.sh) and the run's summary lists what passed. +name: nightly + +on: + schedule: + - cron: '17 2 * * *' + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, labeled] + paths: ['.github/workflows/nightly.yml', 'tools/ci/**'] + +defaults: + run: + shell: bash + +concurrency: + group: nightly-${{ github.ref }} + cancel-in-progress: true + +env: + AMIGA_DISPLAY: ':97' + AMIGA_DISPLAY2: ':98' + +jobs: + pc: + name: PC in DOSBox-X + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: ow + with: + path: ~/openwatcom + key: openwatcom-${{ env.OPENWATCOM_RELEASE }} + - name: OpenWatcom + if: steps.ow.outputs.cache-hit != 'true' + run: | + curl -sSL -o /tmp/ow.tar.xz \ + "https://github.com/open-watcom/open-watcom-v2/releases/download/$OPENWATCOM_RELEASE/ow-snapshot.tar.xz" + mkdir -p ~/openwatcom && tar -xJf /tmp/ow.tar.xz -C ~/openwatcom + - name: DOSBox-X, the displays, the relay + run: | + sudo apt-get update -q + sudo apt-get install -y -q dosbox-x xvfb x11-utils xdotool ffmpeg + tools/ci/displays.sh + tools/ci/relay.sh + build/venv/bin/pip install -q numpy + - name: replays (VGA, EGA, CGA) + run: | + export WATCOM=~/openwatcom + for v in vga ega cga; do + echo "::group::$v" + python3 tools/build_pc.py --test tests/recordings/dm4.bnr --out build/pc/t + tools/ci/retry.sh build/venv/bin/python tools/pc_test.py build/pc/t/BOMBER.EXE --video $v + echo "::endgroup::" + done + echo "- PC replays VGA, EGA, CGA: passed" >> "$GITHUB_STEP_SUMMARY" + - name: keys and sound (speaker, FM) + run: | + export WATCOM=~/openwatcom + python3 tools/build_pc.py --play + tools/ci/retry.sh build/venv/bin/python tools/pc_play.py --sound speaker + tools/ci/retry.sh build/venv/bin/python tools/pc_play.py --sound fm + echo "- PC keys and sound: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match over the modem + run: | + WATCOM=~/openwatcom tools/ci/retry.sh build/venv/bin/python tools/pc_match.py 45 + echo "- PC-PC match, modem: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match over Ethernet (NE2000, packet driver) + run: | + WATCOM=~/openwatcom PC_NET=pkt tools/ci/retry.sh build/venv/bin/python tools/pc_match.py 45 + echo "- PC-PC match, Ethernet: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: | + tail -50 build/relay.log || true + for f in build/pc/match_*/dosbox.log; do echo "== $f"; tail -20 "$f"; done || true + - if: failure() + uses: actions/upload-artifact@v4 + with: + name: pc-failure + path: | + build/pc/*.png + build/pc/match_*/c/NET.LOG + retention-days: 7 + + web: + name: browser in Chrome + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: emsdk + with: + path: ~/emsdk + key: emsdk-${{ env.EMSDK_VERSION }} + - name: Emscripten + if: steps.emsdk.outputs.cache-hit != 'true' + run: | + git clone -q https://github.com/emscripten-core/emsdk.git ~/emsdk + ~/emsdk/emsdk install "$EMSDK_VERSION" && ~/emsdk/emsdk activate "$EMSDK_VERSION" + - name: the displays, the relay + run: | + sudo apt-get update -q && sudo apt-get install -y -q xvfb x11-utils + tools/ci/displays.sh + tools/ci/relay.sh + build/venv/bin/pip install -q websockets + - name: two browsers in a match + env: + CHROMIUM: google-chrome + CHROMIUM_FLAGS: --no-sandbox + run: | + EMSDK=~/emsdk python3 tools/build_web.py + tools/ci/retry.sh build/venv/bin/python tools/web_match.py 30 + echo "- browser-browser match: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true; tail -30 build/chromium.log || true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..57a8ed3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,107 @@ +# A tag vX.Y.Z: the version checked against the game's (GAME_VERSION in +# c/core/game.h), every target built and every test run (the build and test +# workflows), the files gathered under one naming scheme with their SHA-256 +# sums, and a DRAFT release made for them. Publishing it stays a person's +# decision (the release page's "Publish"). +name: release + +on: + push: + tags: ['v*'] + pull_request: # a dry run when this workflow changes: no release, the files as an artifact + paths: ['.github/workflows/release.yml'] + +jobs: + version: + name: the tag matches the game's version + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.v.outputs.version }} + steps: + - uses: actions/checkout@v4 + - id: v + shell: bash + run: | + game=$(sed -n 's/^#define GAME_VERSION "\(.*\)".*/\1/p' c/core/game.h) + [ -n "$game" ] || { echo "::error::no GAME_VERSION in c/core/game.h"; exit 1; } + if [ "$GITHUB_EVENT_NAME" = push ]; then + tag="${GITHUB_REF_NAME#v}" + echo "tag $tag, GAME_VERSION $game" + [ "$tag" = "$game" ] || { echo "::error::tag v$tag but c/core/game.h has GAME_VERSION \"$game\""; exit 1; } + else echo "dry run: GAME_VERSION $game"; fi + echo "version=$game" >> "$GITHUB_OUTPUT" + + build: + needs: version + uses: ./.github/workflows/build.yml + + test: + needs: version + uses: ./.github/workflows/test.yml + + release: + name: draft release + needs: [version, build, test] + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + path: artifacts + - name: the release files + shell: bash + run: | + v=${{ needs.version.outputs.version }} + mkdir dist + put() { [ -f "$1" ] || { echo "::error::missing $1"; exit 1; }; cp "$1" "dist/bombernet-$v-$2"; } + put artifacts/mz/bomber.mzf mz800.mzf + put artifacts/zx/bomber.tap zx-spectrum-48k.tap + put artifacts/zx128/bomber.tap zx-spectrum-128k-esp01.tap + put artifacts/cpc/bomber.dsk amstrad-cpc.dsk + put artifacts/cpc/bomber.cpc amstrad-cpc.cpc + put artifacts/atari/bomber.xex atari-xl.xex + put artifacts/c64/bomber.prg c64.prg + put artifacts/c64/bomber.d64 c64.d64 + put artifacts/amiga/bomber amiga + put artifacts/amiga/bombernet.adf amiga.adf + put artifacts/st/BOMBER.PRG atari-st.prg + put artifacts/st/bombernet.st atari-st.st + put artifacts/pc/BOMBER.EXE pc-dos.exe + put artifacts/pc/bombernet.img pc-dos.img + (cd artifacts/web && zip -q -9 "../../dist/bombernet-$v-web.zip" bombernet.html bombernet.js bombernet.wasm) + (cd dist && sha256sum * > SHA256SUMS) + ls -l dist + - name: the files (a dry run) + if: github.event_name != 'push' + uses: actions/upload-artifact@v4 + with: + name: release-files + path: dist/ + retention-days: 7 + - name: draft release + if: github.event_name == 'push' + env: + GH_TOKEN: ${{ github.token }} + shell: bash + run: | + v=${{ needs.version.outputs.version }} + cat > notes.md < /dev/null 2>&1 & +done +for i in $(seq 50); do xdpyinfo -display :97 > /dev/null 2>&1 && xdpyinfo -display :98 > /dev/null 2>&1 && exit 0; sleep 0.2; done +echo "Xvfb did not start"; exit 1 diff --git a/tools/ci/relay.sh b/tools/ci/relay.sh new file mode 100755 index 0000000..0d19d71 --- /dev/null +++ b/tools/ci/relay.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# The local reference relay on 127.0.0.1:8765 (WebSocket) and 8766 (TCP), log in build/relay.log. +cd "$(dirname "$0")/../.." || exit 1 +[ -x build/venv/bin/uvicorn ] || { python3 -m venv build/venv && build/venv/bin/pip install -q -r relay/requirements.txt; } +(cd relay && ../build/venv/bin/uvicorn relay:app --host 127.0.0.1 --port 8765 > ../build/relay.log 2>&1 &) +for i in $(seq 50); do nc -z 127.0.0.1 8765 && exit 0; sleep 0.2; done +echo "the relay did not start"; tail -20 build/relay.log; exit 1 diff --git a/tools/ci/retry.sh b/tools/ci/retry.sh new file mode 100755 index 0000000..4abdd57 --- /dev/null +++ b/tools/ci/retry.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# A test that runs emulators in real time, given one more chance: tools/ci/retry.sh command args... +# (a busy CI machine can starve an emulator for a moment; a real failure fails twice) +"$@" && exit 0 +echo "::warning::failed once, retrying: $*" +sleep 5 +exec "$@" diff --git a/tools/webpage.py b/tools/webpage.py index 7a8a500..1d8eba3 100644 --- a/tools/webpage.py +++ b/tools/webpage.py @@ -4,6 +4,8 @@ tools/crossplay.py's web machine): open a page, keys, JavaScript, screenshots. Chromium runs on the invisible X display (:97, as tools/netbench.py starts it; its own profile: Chromium ignores the debugging port on the default one). +CHROMIUM: the browser (default the snap's chromium); CHROMIUM_FLAGS: more +flags (CI: --no-sandbox, where the runner gives no user namespaces). serve(dir) serves a build directory over HTTP on 127.0.0.1 for the page.""" import base64, functools, http.server, itertools, json, os, socket, subprocess, sys, threading, time, urllib.request from websockets.sync.client import connect @@ -22,7 +24,8 @@ def chromium(): subprocess.Popen([CHROMIUM, f'--remote-debugging-port={PORT}', f'--user-data-dir={profile}', '--no-first-run', '--autoplay-policy=no-user-gesture-required', '--ignore-gpu-blocklist', '--enable-unsafe-swiftshader', '--disable-background-timer-throttling', '--disable-renderer-backgrounding', - '--disable-backgrounding-occluded-windows', 'about:blank'], env=env, + '--disable-backgrounding-occluded-windows', *os.environ.get('CHROMIUM_FLAGS', '').split(), + 'about:blank'], env=env, stdout=open(os.path.join(ROOT, 'build', 'chromium.log'), 'w'), stderr=subprocess.STDOUT) for _ in range(60): try: socket.create_connection(('127.0.0.1', PORT), timeout=1).close(); return From 4ecae5166c492ad0569989b4a953573ac3644062 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 17:55:25 +0200 Subject: [PATCH 02/17] CI: build and test called by the release run in a concurrency group of their own (they cancelled each other) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8082bd..348b789 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ defaults: # command piped into tail would pass) concurrency: - group: build-${{ github.ref }}-${{ github.event_name }} + group: ${{ github.workflow }}-build-${{ github.ref }} # (called by release.yml: the caller's name, a group of its own) cancel-in-progress: true jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3c6b62..c3bf022 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ defaults: # command piped into tail would pass) concurrency: - group: test-${{ github.ref }}-${{ github.event_name }} + group: ${{ github.workflow }}-test-${{ github.ref }} # (called by release.yml: the caller's name, a group of its own) cancel-in-progress: true jobs: From d9418f18b3dfb56c9dfe2faeb3a1e53f33b6897f Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 17:56:23 +0200 Subject: [PATCH 03/17] CI nightly: the Atari ST (Hatari, EmuTOS from source) and the Amiga (FS-UAE, A1200) amiga_match.py ends with the verdict in its exit status (it printed it and returned 0). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 73 +++++++++++++++++++++++++++++++++++ tools/amiga_match.py | 1 + tools/ci/toolchains.env | 2 + 3 files changed, 76 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6910be3..8733a8d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -125,3 +125,76 @@ jobs: echo "- browser-browser match: passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() run: tail -50 build/relay.log || true; tail -30 build/chromium.log || true + + st: + name: Atari ST in Hatari + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - name: cross-mint, Hatari, the displays, the relay + run: | + sudo add-apt-repository -y ppa:vriviere/ppa + sudo apt-get update -q + sudo apt-get install -y -q cross-mint-essential hatari xvfb x11-utils xdotool ffmpeg + tools/ci/displays.sh + tools/ci/relay.sh + - uses: actions/cache@v4 + id: emutos + with: + path: build/st/rom + key: emutos-${{ env.EMUTOS_COMMIT }} + - name: EmuTOS (no TOS ships with Hatari; built from source, pinned) + if: steps.emutos.outputs.cache-hit != 'true' + run: | + git clone -q https://github.com/emutos/emutos.git /tmp/emutos && git -C /tmp/emutos checkout -q "$EMUTOS_COMMIT" + mkdir -p build/st/rom + for t in "192 uk" "192 us" "256 uk"; do + set -- $t + make -C /tmp/emutos clean > /dev/null && make -C /tmp/emutos -j4 $1 UNIQUE=$2 > /dev/null + cp /tmp/emutos/etos$1$2.img build/st/rom/ + done + ls -l build/st/rom + - name: replay + run: | + python3 tools/build_st.py --test tests/recordings/dm4.bnr + tools/ci/retry.sh python3 tools/st_test.py + echo "- ST replay: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match over the WiFi modems + run: | + ST_DISPLAY=:98 tools/ci/retry.sh build/venv/bin/python tools/st_match.py 45 + echo "- ST-ST match: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true; tail -30 build/st/hatari.log || true + + amiga: + name: Amiga in FS-UAE + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + env: + AMIGA_MODEL: A1200 # FS-UAE's own AROS ROM (no download); on an A500 it crashed in a match + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - name: bebbo's gcc, FS-UAE, the displays, the relay + run: | + docker pull -q "$AMIGA_IMAGE" && docker tag "$AMIGA_IMAGE" amigadev/crosstools:m68k-amigaos + sudo apt-get update -q + sudo apt-get install -y -q fs-uae xvfb x11-utils xdotool ffmpeg + tools/ci/displays.sh + tools/ci/relay.sh + - name: replay + run: | + python3 tools/build_amiga.py --test tests/recordings/dm4.bnr + DISPLAY=:97 tools/ci/retry.sh python3 tools/amiga_test.py --model A1200 + echo "- Amiga replay: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match + run: | + tools/ci/retry.sh build/venv/bin/python tools/amiga_match.py 45 + echo "- Amiga-Amiga match: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true; tail -30 build/amiga/fsuae.log || true + diff --git a/tools/amiga_match.py b/tools/amiga_match.py index e293727..5e4750c 100755 --- a/tools/amiga_match.py +++ b/tools/amiga_match.py @@ -109,5 +109,6 @@ def close(self): self.p.kill() print(f'host frame {hs["frame"]} abort {hs["abort"]}, join frame {js["frame"]} abort {js["abort"]}; ' f'{len(common)} hashed frames compared, {len(mism)} mismatches' + (f' (first at {mism[0]})' if mism else '') + f'; {float(hs["frame"]) / (time.time() - t0):.1f} frames a second', flush=True) + sys.exit(1 if mism or hs['abort'] != '0' or js['abort'] != '0' or not common else 0) finally: host.close(); join.close() diff --git a/tools/ci/toolchains.env b/tools/ci/toolchains.env index c8b3e92..bad8685 100644 --- a/tools/ci/toolchains.env +++ b/tools/ci/toolchains.env @@ -15,3 +15,5 @@ AMITOOLS_VERSION=0.8.1 # the Python emulators the tests use (tools/zxemu.py, tools/cpcemu.py), from PyPI ZX_EMU_VERSION=0.13.15 Z80_EMU_VERSION=1.2.0 +# EmuTOS (the Atari ST tests: Hatari ships no TOS), a commit of github.com/emutos/emutos +EMUTOS_COMMIT=02c2db7 From 478b0fe2421917621d8bb83dd7821ffbbda19a8c Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 17:57:45 +0200 Subject: [PATCH 04/17] CI nightly: the C64 in VICE (built from the 3.9 tarball with our patch, cached) c64_match.py ends with a verdict: no abort (the relay compares the hashes every 16 frames and aborts both on a difference) and enough frames played. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 56 +++++++++++++++++++++++++++++++++++ tools/c64_match.py | 5 ++++ tools/ci/toolchains.env | 2 ++ 3 files changed, 63 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8733a8d..4d83eab 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -198,3 +198,59 @@ jobs: - if: failure() run: tail -50 build/relay.log || true; tail -30 build/amiga/fsuae.log || true + c64: + name: C64 in VICE + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: | + grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + echo "VICE_PATCH_HASH=$(sha256sum tools/c64/vice-3.9-bombernet.patch | cut -c1-16)" >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: sdk + with: + path: ~/llvm-mos + key: llvm-mos-${{ env.LLVM_MOS_VERSION }} + - name: llvm-mos SDK + if: steps.sdk.outputs.cache-hit != 'true' + run: | + curl -sSL -o /tmp/llvm-mos.tar.xz \ + "https://github.com/llvm-mos/llvm-mos-sdk/releases/download/$LLVM_MOS_VERSION/llvm-mos-linux.tar.xz" + tar -xJf /tmp/llvm-mos.tar.xz -C ~ + - uses: actions/cache@v4 + id: vice + with: + path: ~/vice-dist + key: vice-${{ env.VICE_VERSION }}-${{ env.VICE_PATCH_HASH }} + - name: VICE, headless, with the BomberNet patch (monitor keys, WiC64 firmware timing, the Ultimate's network) + if: steps.vice.outputs.cache-hit != 'true' + run: | + sudo apt-get update -q + sudo apt-get install -y -q build-essential pkg-config xa65 dos2unix libcurl4-openssl-dev flex bison + curl -sSL -o /tmp/vice.tar.gz "https://sourceforge.net/projects/vice-emu/files/releases/vice-$VICE_VERSION.tar.gz/download" + tar -xzf /tmp/vice.tar.gz -C /tmp + cd /tmp/vice-$VICE_VERSION && patch -p1 < "$GITHUB_WORKSPACE/tools/c64/vice-3.9-bombernet.patch" + ./configure --prefix="$HOME/vice-dist" --enable-headlessui --disable-html-docs --disable-pdf-docs \ + --without-alsa --without-pulse --without-oss --without-evdev --with-libcurl > /dev/null + make -j4 > /dev/null && make install > /dev/null + ls ~/vice-dist/bin + - name: the relay + run: tools/ci/relay.sh + - name: replay + run: | + export VICE=$HOME/vice-dist/bin/x64sc LLVM_MOS=$HOME/llvm-mos + python3 tools/build_c64.py --test tests/recordings/dm4.bnr + tools/ci/retry.sh build/venv/bin/python tools/c64_test.py + echo "- C64 replay: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match, WiC64 (the firmware's timing) and the Ultimate's network + run: | + export VICE=$HOME/vice-dist/bin/x64sc LLVM_MOS=$HOME/llvm-mos + CFLAGS_C64=-DC64_NETTIME python3 tools/build_c64.py --out build/c64nt + WIC64_FW_TIMING=1 tools/ci/retry.sh build/venv/bin/python tools/c64_match.py 30 + C64_NET=uci tools/ci/retry.sh build/venv/bin/python tools/c64_match.py 30 + echo "- C64-C64 matches (WiC64, Ultimate): passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true + diff --git a/tools/c64_match.py b/tools/c64_match.py index 01e6831..25de6e4 100755 --- a/tools/c64_match.py +++ b/tools/c64_match.py @@ -77,5 +77,10 @@ def tap(v): f'abort {v.u8("net_abort")}', flush=True) print('state hashes', host.mem('state_hash', 2).hex(), join.mem('state_hash', 2).hex(), 'at frames', host.u16('frame_no'), join.u16('frame_no')) + # the verdict: the relay compares the hashes every 16 frames and aborts both on a difference (an abort + # flag), so no abort and enough frames played (10 a second at least) is a pass + played = min(v.u16('frame_no') - fr for v, (fr, _) in zip(both, f0)) + aborts = [v.u8('net_abort') for v in both] + sys.exit(1 if any(aborts) or played < SECS * 10 else 0) finally: for v in both: v.close() diff --git a/tools/ci/toolchains.env b/tools/ci/toolchains.env index bad8685..8da3089 100644 --- a/tools/ci/toolchains.env +++ b/tools/ci/toolchains.env @@ -17,3 +17,5 @@ ZX_EMU_VERSION=0.13.15 Z80_EMU_VERSION=1.2.0 # EmuTOS (the Atari ST tests: Hatari ships no TOS), a commit of github.com/emutos/emutos EMUTOS_COMMIT=02c2db7 +# VICE (the C64 tests), built from its release tarball with tools/c64/vice-3.9-bombernet.patch +VICE_VERSION=3.9 From f7264a5ec71752bdb96c31aa23a9fd791a9aac26 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:00:43 +0200 Subject: [PATCH 05/17] CI nightly: the MZ-800 in mz800emu (built from the MZPico fork with SDL3 from source, cached); VICE needs libpng Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 61 +++++++++++++++++++++++++++++++- tools/ci/emucfg_net/mz800emu.ini | 7 ++++ tools/ci/toolchains.env | 5 +++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tools/ci/emucfg_net/mz800emu.ini diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4d83eab..0b4454a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -228,7 +228,7 @@ jobs: if: steps.vice.outputs.cache-hit != 'true' run: | sudo apt-get update -q - sudo apt-get install -y -q build-essential pkg-config xa65 dos2unix libcurl4-openssl-dev flex bison + sudo apt-get install -y -q build-essential pkg-config xa65 dos2unix libcurl4-openssl-dev flex bison libpng-dev zlib1g-dev curl -sSL -o /tmp/vice.tar.gz "https://sourceforge.net/projects/vice-emu/files/releases/vice-$VICE_VERSION.tar.gz/download" tar -xzf /tmp/vice.tar.gz -C /tmp cd /tmp/vice-$VICE_VERSION && patch -p1 < "$GITHUB_WORKSPACE/tools/c64/vice-3.9-bombernet.patch" @@ -254,3 +254,62 @@ jobs: - if: failure() run: tail -50 build/relay.log || true + mz: + name: MZ-800 in mz800emu + runs-on: ubuntu-24.04 + if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + env: + MZ800EMU: /home/runner/mz800emu/bin/mz800emu + MZ800EMU_CFG: build/emucfg_net + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: emu + with: + path: ~/mz800emu + key: mz800emu-${{ env.MZ800EMU_COMMIT }}-${{ env.SDL3_TAG }}-${{ env.SDL3_IMAGE_TAG }}-${{ env.MINIZIP_NG_COMMIT }} + - name: mz800emu and its libraries (SDL3, SDL3_image, minizip-ng from source) + if: steps.emu.outputs.cache-hit != 'true' + run: | + sudo apt-get update -q + sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libcurl4-openssl-dev \ + zlib1g-dev libx11-dev libxext-dev + P=$HOME/mz800emu + build() { # repository, ref, cmake options + git clone -q "$1" /tmp/src && git -C /tmp/src checkout -q "$2" + cmake -S /tmp/src -B /tmp/src/b -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$P" \ + -DCMAKE_PREFIX_PATH="$P" "${@:3}" > /dev/null + cmake --build /tmp/src/b > /dev/null && cmake --install /tmp/src/b > /dev/null + rm -rf /tmp/src + } + build https://github.com/libsdl-org/SDL.git "$SDL3_TAG" -DSDL_TESTS=OFF + build https://github.com/libsdl-org/SDL_image.git "$SDL3_IMAGE_TAG" -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_WEBP=OFF -DSDLIMAGE_TIF=OFF -DSDLIMAGE_JXL=OFF + build https://github.com/zlib-ng/minizip-ng.git "$MINIZIP_NG_COMMIT" -DMZ_COMPAT=OFF -DMZ_ZSTD=OFF -DMZ_LZMA=OFF -DMZ_BZIP2=OFF -DMZ_OPENSSL=OFF -DMZ_LIBBSD=OFF -DMZ_ICONV=OFF -DMZ_FETCH_LIBS=OFF + git clone -q https://github.com/MZPico/mz800emu.git /tmp/emu && git -C /tmp/emu checkout -q "$MZ800EMU_COMMIT" + PKG_CONFIG_PATH="$P/lib/pkgconfig:$P/lib/x86_64-linux-gnu/pkgconfig" cmake -S /tmp/emu -B /tmp/emu/b -G Ninja \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$P" -DMZ_BUILD_MZ1500=OFF -DMZ_BUILD_MZ700_PAL=OFF \ + -DMZ_BUILD_MZ700_NTSC=OFF -DBUILD_TESTING=OFF > /dev/null + cmake --build /tmp/emu/b > /dev/null + mkdir -p "$P/bin" && cp "$(find /tmp/emu/b -name mz800emu -type f -perm -u+x | head -1)" "$P/bin/" + ls -l "$P/bin" + - name: the MZ-800 build, the relay + run: | + echo "LD_LIBRARY_PATH=$HOME/mz800emu/lib:$HOME/mz800emu/lib/x86_64-linux-gnu" >> "$GITHUB_ENV" + docker pull -q "$Z88DK_IMAGE" + export PATH="$PWD/tools/ci/z88dk:$PATH" + mkdir -p build/c && (cd build/c && cmake ../../c > /dev/null && make) + mkdir -p build/emucfg_net && cp tools/ci/emucfg_net/mz800emu.ini build/emucfg_net/ + tools/ci/relay.sh + - name: replays + run: | + for r in tests/recordings/*.bnr; do echo "== $r"; build/venv/bin/python tools/replay.py "$r" | tail -1; done + echo "- MZ-800 replays: passed" >> "$GITHUB_STEP_SUMMARY" + - name: match through the relay + run: | + tools/ci/retry.sh build/venv/bin/python tools/lockstep_test.py 300 + echo "- MZ-MZ match: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true + diff --git a/tools/ci/emucfg_net/mz800emu.ini b/tools/ci/emucfg_net/mz800emu.ini new file mode 100644 index 0000000..0d995ad --- /dev/null +++ b/tools/ci/emucfg_net/mz800emu.ini @@ -0,0 +1,7 @@ +; mz800emu's settings for the network tests (the CI copies this into build/emucfg_net; MZ800EMU_CFG): +; the Unicard as an MZPico with its NET extension, talking to the local relay's TCP port. +[UNICARD] +mzpico_mode = 1 +net_relay = 127.0.0.1:8766 +connected = 1 +readonly = 0 diff --git a/tools/ci/toolchains.env b/tools/ci/toolchains.env index 8da3089..7ddfbd3 100644 --- a/tools/ci/toolchains.env +++ b/tools/ci/toolchains.env @@ -19,3 +19,8 @@ Z80_EMU_VERSION=1.2.0 EMUTOS_COMMIT=02c2db7 # VICE (the C64 tests), built from its release tarball with tools/c64/vice-3.9-bombernet.patch VICE_VERSION=3.9 +# mz800emu (the MZ-800 tests): the MZPico fork's commit, and the libraries it needs that Ubuntu lacks +MZ800EMU_COMMIT=45725d7 +SDL3_TAG=release-3.4.14 +SDL3_IMAGE_TAG=release-3.4.4 +MINIZIP_NG_COMMIT=7d2917b From 5ca5c747c23f5107091c430aa7158f2b9d6f3150 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:08:55 +0200 Subject: [PATCH 06/17] CI nightly: SDL3's build dependencies (X11, ALSA), no Wayland Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0b4454a..aba4f3c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -275,7 +275,8 @@ jobs: run: | sudo apt-get update -q sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libcurl4-openssl-dev \ - zlib1g-dev libx11-dev libxext-dev + zlib1g-dev libpng-dev libjpeg-dev libasound2-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ + libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libgl1-mesa-dev libegl1-mesa-dev libdbus-1-dev libudev-dev P=$HOME/mz800emu build() { # repository, ref, cmake options git clone -q "$1" /tmp/src && git -C /tmp/src checkout -q "$2" @@ -284,7 +285,7 @@ jobs: cmake --build /tmp/src/b > /dev/null && cmake --install /tmp/src/b > /dev/null rm -rf /tmp/src } - build https://github.com/libsdl-org/SDL.git "$SDL3_TAG" -DSDL_TESTS=OFF + build https://github.com/libsdl-org/SDL.git "$SDL3_TAG" -DSDL_TESTS=OFF -DSDL_WAYLAND=OFF -DSDL_PIPEWIRE=OFF -DSDL_PULSEAUDIO=OFF -DSDL_JACK=OFF -DSDL_SNDIO=OFF build https://github.com/libsdl-org/SDL_image.git "$SDL3_IMAGE_TAG" -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_WEBP=OFF -DSDLIMAGE_TIF=OFF -DSDLIMAGE_JXL=OFF build https://github.com/zlib-ng/minizip-ng.git "$MINIZIP_NG_COMMIT" -DMZ_COMPAT=OFF -DMZ_ZSTD=OFF -DMZ_LZMA=OFF -DMZ_BZIP2=OFF -DMZ_OPENSSL=OFF -DMZ_LIBBSD=OFF -DMZ_ICONV=OFF -DMZ_FETCH_LIBS=OFF git clone -q https://github.com/MZPico/mz800emu.git /tmp/emu && git -C /tmp/emu checkout -q "$MZ800EMU_COMMIT" From ef085e705a89af8929b98acecac81daa332ac818 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:16:13 +0200 Subject: [PATCH 07/17] CI nightly: mz800emu needs json-glib Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aba4f3c..b6d7119 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -274,7 +274,7 @@ jobs: if: steps.emu.outputs.cache-hit != 'true' run: | sudo apt-get update -q - sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libcurl4-openssl-dev \ + sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libjson-glib-dev libcurl4-openssl-dev \ zlib1g-dev libpng-dev libjpeg-dev libasound2-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libgl1-mesa-dev libegl1-mesa-dev libdbus-1-dev libudev-dev P=$HOME/mz800emu From 1054776102f0190d4ed76a6917010a3498cf7166 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:23:58 +0200 Subject: [PATCH 08/17] CI nightly: the apt packages on every run (cached VICE and mz800emu link against them); the MZ build's log when it fails Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b6d7119..bce5419 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -225,10 +225,10 @@ jobs: path: ~/vice-dist key: vice-${{ env.VICE_VERSION }}-${{ env.VICE_PATCH_HASH }} - name: VICE, headless, with the BomberNet patch (monitor keys, WiC64 firmware timing, the Ultimate's network) - if: steps.vice.outputs.cache-hit != 'true' run: | - sudo apt-get update -q + sudo apt-get update -q # on every run: the cached VICE links against these sudo apt-get install -y -q build-essential pkg-config xa65 dos2unix libcurl4-openssl-dev flex bison libpng-dev zlib1g-dev + [ "${{ steps.vice.outputs.cache-hit }}" = true ] && exit 0 curl -sSL -o /tmp/vice.tar.gz "https://sourceforge.net/projects/vice-emu/files/releases/vice-$VICE_VERSION.tar.gz/download" tar -xzf /tmp/vice.tar.gz -C /tmp cd /tmp/vice-$VICE_VERSION && patch -p1 < "$GITHUB_WORKSPACE/tools/c64/vice-3.9-bombernet.patch" @@ -271,18 +271,20 @@ jobs: path: ~/mz800emu key: mz800emu-${{ env.MZ800EMU_COMMIT }}-${{ env.SDL3_TAG }}-${{ env.SDL3_IMAGE_TAG }}-${{ env.MINIZIP_NG_COMMIT }} - name: mz800emu and its libraries (SDL3, SDL3_image, minizip-ng from source) - if: steps.emu.outputs.cache-hit != 'true' run: | - sudo apt-get update -q + sudo apt-get update -q # on every run: the cached mz800emu links against these sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libjson-glib-dev libcurl4-openssl-dev \ zlib1g-dev libpng-dev libjpeg-dev libasound2-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libgl1-mesa-dev libegl1-mesa-dev libdbus-1-dev libudev-dev + [ "${{ steps.emu.outputs.cache-hit }}" = true ] && exit 0 P=$HOME/mz800emu + set -E; trap 'tail -60 /tmp/build.log' ERR build() { # repository, ref, cmake options git clone -q "$1" /tmp/src && git -C /tmp/src checkout -q "$2" cmake -S /tmp/src -B /tmp/src/b -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$P" \ - -DCMAKE_PREFIX_PATH="$P" "${@:3}" > /dev/null - cmake --build /tmp/src/b > /dev/null && cmake --install /tmp/src/b > /dev/null + -DCMAKE_PREFIX_PATH="$P" "${@:3}" > /tmp/build.log 2>&1 + cmake --build /tmp/src/b > /tmp/build.log 2>&1 + cmake --install /tmp/src/b > /tmp/build.log 2>&1 rm -rf /tmp/src } build https://github.com/libsdl-org/SDL.git "$SDL3_TAG" -DSDL_TESTS=OFF -DSDL_WAYLAND=OFF -DSDL_PIPEWIRE=OFF -DSDL_PULSEAUDIO=OFF -DSDL_JACK=OFF -DSDL_SNDIO=OFF @@ -291,8 +293,8 @@ jobs: git clone -q https://github.com/MZPico/mz800emu.git /tmp/emu && git -C /tmp/emu checkout -q "$MZ800EMU_COMMIT" PKG_CONFIG_PATH="$P/lib/pkgconfig:$P/lib/x86_64-linux-gnu/pkgconfig" cmake -S /tmp/emu -B /tmp/emu/b -G Ninja \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$P" -DMZ_BUILD_MZ1500=OFF -DMZ_BUILD_MZ700_PAL=OFF \ - -DMZ_BUILD_MZ700_NTSC=OFF -DBUILD_TESTING=OFF > /dev/null - cmake --build /tmp/emu/b > /dev/null + -DMZ_BUILD_MZ700_NTSC=OFF -DBUILD_TESTING=OFF > /tmp/build.log 2>&1 + cmake --build /tmp/emu/b > /tmp/build.log 2>&1 mkdir -p "$P/bin" && cp "$(find /tmp/emu/b -name mz800emu -type f -perm -u+x | head -1)" "$P/bin/" ls -l "$P/bin" - name: the MZ-800 build, the relay From 86628f7848ba727a22d8ac8c1dfb896c12a6249f Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:36:46 +0200 Subject: [PATCH 09/17] CI nightly: minizip-ng's library path for the mz800emu link; VICE's own output when the C64 job fails Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bce5419..633b21c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -253,6 +253,11 @@ jobs: echo "- C64-C64 matches (WiC64, Ultimate): passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() run: tail -50 build/relay.log || true + - if: failure() + name: VICE on its own (why it stopped) + run: | + ldd ~/vice-dist/bin/x64sc | grep 'not found' || true + timeout 20 ~/vice-dist/bin/x64sc +logcolorize -default -sounddev dummy -limitcycles 2000000 2>&1 | tail -40 || true mz: name: MZ-800 in mz800emu @@ -291,6 +296,7 @@ jobs: build https://github.com/libsdl-org/SDL_image.git "$SDL3_IMAGE_TAG" -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_WEBP=OFF -DSDLIMAGE_TIF=OFF -DSDLIMAGE_JXL=OFF build https://github.com/zlib-ng/minizip-ng.git "$MINIZIP_NG_COMMIT" -DMZ_COMPAT=OFF -DMZ_ZSTD=OFF -DMZ_LZMA=OFF -DMZ_BZIP2=OFF -DMZ_OPENSSL=OFF -DMZ_LIBBSD=OFF -DMZ_ICONV=OFF -DMZ_FETCH_LIBS=OFF git clone -q https://github.com/MZPico/mz800emu.git /tmp/emu && git -C /tmp/emu checkout -q "$MZ800EMU_COMMIT" + export LIBRARY_PATH="$P/lib" # the minizip-ng it links names -lminizip-ng without its -L PKG_CONFIG_PATH="$P/lib/pkgconfig:$P/lib/x86_64-linux-gnu/pkgconfig" cmake -S /tmp/emu -B /tmp/emu/b -G Ninja \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$P" -DMZ_BUILD_MZ1500=OFF -DMZ_BUILD_MZ700_PAL=OFF \ -DMZ_BUILD_MZ700_NTSC=OFF -DBUILD_TESTING=OFF > /tmp/build.log 2>&1 From 888392e7a86081cbda098e31daa5abb534d037d9 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:43:44 +0200 Subject: [PATCH 10/17] CI nightly: minizip-ng without PPMd (its static library left the codec's symbols out) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 633b21c..fb9ab67 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -294,7 +294,7 @@ jobs: } build https://github.com/libsdl-org/SDL.git "$SDL3_TAG" -DSDL_TESTS=OFF -DSDL_WAYLAND=OFF -DSDL_PIPEWIRE=OFF -DSDL_PULSEAUDIO=OFF -DSDL_JACK=OFF -DSDL_SNDIO=OFF build https://github.com/libsdl-org/SDL_image.git "$SDL3_IMAGE_TAG" -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_WEBP=OFF -DSDLIMAGE_TIF=OFF -DSDLIMAGE_JXL=OFF - build https://github.com/zlib-ng/minizip-ng.git "$MINIZIP_NG_COMMIT" -DMZ_COMPAT=OFF -DMZ_ZSTD=OFF -DMZ_LZMA=OFF -DMZ_BZIP2=OFF -DMZ_OPENSSL=OFF -DMZ_LIBBSD=OFF -DMZ_ICONV=OFF -DMZ_FETCH_LIBS=OFF + build https://github.com/zlib-ng/minizip-ng.git "$MINIZIP_NG_COMMIT" -DMZ_COMPAT=OFF -DMZ_ZSTD=OFF -DMZ_LZMA=OFF -DMZ_PPMD=OFF -DMZ_BZIP2=OFF -DMZ_OPENSSL=OFF -DMZ_LIBBSD=OFF -DMZ_ICONV=OFF -DMZ_FETCH_LIBS=OFF git clone -q https://github.com/MZPico/mz800emu.git /tmp/emu && git -C /tmp/emu checkout -q "$MZ800EMU_COMMIT" export LIBRARY_PATH="$P/lib" # the minizip-ng it links names -lminizip-ng without its -L PKG_CONFIG_PATH="$P/lib/pkgconfig:$P/lib/x86_64-linux-gnu/pkgconfig" cmake -S /tmp/emu -B /tmp/emu/b -G Ninja \ From 3aaef3b8fc6ac0f8beffa0e4ebb29f56efc2caf6 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:51:16 +0200 Subject: [PATCH 11/17] CI nightly: mz800emu with its ui_resources; its log when the MZ job fails Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fb9ab67..c3d905d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -266,6 +266,7 @@ jobs: env: MZ800EMU: /home/runner/mz800emu/bin/mz800emu MZ800EMU_CFG: build/emucfg_net + MZ800EMU_LOG: build/mz800emu.log steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -274,7 +275,7 @@ jobs: id: emu with: path: ~/mz800emu - key: mz800emu-${{ env.MZ800EMU_COMMIT }}-${{ env.SDL3_TAG }}-${{ env.SDL3_IMAGE_TAG }}-${{ env.MINIZIP_NG_COMMIT }} + key: mz800emu-2-${{ env.MZ800EMU_COMMIT }}-${{ env.SDL3_TAG }}-${{ env.SDL3_IMAGE_TAG }}-${{ env.MINIZIP_NG_COMMIT }} - name: mz800emu and its libraries (SDL3, SDL3_image, minizip-ng from source) run: | sudo apt-get update -q # on every run: the cached mz800emu links against these @@ -301,7 +302,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$P" -DMZ_BUILD_MZ1500=OFF -DMZ_BUILD_MZ700_PAL=OFF \ -DMZ_BUILD_MZ700_NTSC=OFF -DBUILD_TESTING=OFF > /tmp/build.log 2>&1 cmake --build /tmp/emu/b > /tmp/build.log 2>&1 - mkdir -p "$P/bin" && cp "$(find /tmp/emu/b -name mz800emu -type f -perm -u+x | head -1)" "$P/bin/" + rm -rf "$P/bin" && cp -r "$(dirname "$(find /tmp/emu/b -name mz800emu -type f -perm -u+x | head -1)")" "$P/bin" # with its ui_resources ls -l "$P/bin" - name: the MZ-800 build, the relay run: | @@ -320,5 +321,5 @@ jobs: tools/ci/retry.sh build/venv/bin/python tools/lockstep_test.py 300 echo "- MZ-MZ match: passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() - run: tail -50 build/relay.log || true + run: tail -50 build/relay.log build/mz800emu.log || true From 34554bbd9fa6681683d75522cf50ebb0b41c8ff9 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 18:58:44 +0200 Subject: [PATCH 12/17] CI nightly: VICE without -march=native (a cached build ran on another runner's CPU: illegal instruction); the MZ log's tail Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c3d905d..48e32cf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -223,7 +223,7 @@ jobs: id: vice with: path: ~/vice-dist - key: vice-${{ env.VICE_VERSION }}-${{ env.VICE_PATCH_HASH }} + key: vice-2-${{ env.VICE_VERSION }}-${{ env.VICE_PATCH_HASH }} - name: VICE, headless, with the BomberNet patch (monitor keys, WiC64 firmware timing, the Ultimate's network) run: | sudo apt-get update -q # on every run: the cached VICE links against these @@ -232,7 +232,7 @@ jobs: curl -sSL -o /tmp/vice.tar.gz "https://sourceforge.net/projects/vice-emu/files/releases/vice-$VICE_VERSION.tar.gz/download" tar -xzf /tmp/vice.tar.gz -C /tmp cd /tmp/vice-$VICE_VERSION && patch -p1 < "$GITHUB_WORKSPACE/tools/c64/vice-3.9-bombernet.patch" - ./configure --prefix="$HOME/vice-dist" --enable-headlessui --disable-html-docs --disable-pdf-docs \ + ./configure --prefix="$HOME/vice-dist" --enable-headlessui --disable-arch --disable-html-docs --disable-pdf-docs \ --without-alsa --without-pulse --without-oss --without-evdev --with-libcurl > /dev/null make -j4 > /dev/null && make install > /dev/null ls ~/vice-dist/bin @@ -321,5 +321,5 @@ jobs: tools/ci/retry.sh build/venv/bin/python tools/lockstep_test.py 300 echo "- MZ-MZ match: passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() - run: tail -50 build/relay.log build/mz800emu.log || true + run: tail -n 50 build/relay.log build/mz800emu.log || true From 7acf3e086f1a0873786cf24be353fb6b9abb36c4 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 19:15:59 +0200 Subject: [PATCH 13/17] CI nightly: mz800emu on an invisible X display (SDL opens its video even headless) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 48e32cf..0016271 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -267,6 +267,7 @@ jobs: MZ800EMU: /home/runner/mz800emu/bin/mz800emu MZ800EMU_CFG: build/emucfg_net MZ800EMU_LOG: build/mz800emu.log + DISPLAY: ':97' # headless, but SDL still opens its video (an invisible X display) steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -279,7 +280,7 @@ jobs: - name: mz800emu and its libraries (SDL3, SDL3_image, minizip-ng from source) run: | sudo apt-get update -q # on every run: the cached mz800emu links against these - sudo apt-get install -y -q build-essential cmake ninja-build pkg-config libglib2.0-dev libjson-glib-dev libcurl4-openssl-dev \ + sudo apt-get install -y -q xvfb x11-utils libgl1-mesa-dri build-essential cmake ninja-build pkg-config libglib2.0-dev libjson-glib-dev libcurl4-openssl-dev \ zlib1g-dev libpng-dev libjpeg-dev libasound2-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \ libxfixes-dev libxi-dev libxss-dev libxtst-dev libxkbcommon-dev libgl1-mesa-dev libegl1-mesa-dev libdbus-1-dev libudev-dev [ "${{ steps.emu.outputs.cache-hit }}" = true ] && exit 0 @@ -311,6 +312,7 @@ jobs: export PATH="$PWD/tools/ci/z88dk:$PATH" mkdir -p build/c && (cd build/c && cmake ../../c > /dev/null && make) mkdir -p build/emucfg_net && cp tools/ci/emucfg_net/mz800emu.ini build/emucfg_net/ + tools/ci/displays.sh tools/ci/relay.sh - name: replays run: | From 5f290d365d5d98929aa50bbcb1fbf0b9b5ad530f Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 19:36:53 +0200 Subject: [PATCH 14/17] CI nightly: cross-play, the MZ with the Spectrum and the CPC, and the Spectrum with the CPC Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0016271..d79ca39 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -310,7 +310,9 @@ jobs: echo "LD_LIBRARY_PATH=$HOME/mz800emu/lib:$HOME/mz800emu/lib/x86_64-linux-gnu" >> "$GITHUB_ENV" docker pull -q "$Z88DK_IMAGE" export PATH="$PWD/tools/ci/z88dk:$PATH" - mkdir -p build/c && (cd build/c && cmake ../../c > /dev/null && make) + for p in mz:c zx:zx cpc:cpc; do + mkdir -p build/${p#*:} && (cd build/${p#*:} && cmake -DPLATFORM=${p%%:*} ../../c > /dev/null && make) + done mkdir -p build/emucfg_net && cp tools/ci/emucfg_net/mz800emu.ini build/emucfg_net/ tools/ci/displays.sh tools/ci/relay.sh @@ -322,6 +324,13 @@ jobs: run: | tools/ci/retry.sh build/venv/bin/python tools/lockstep_test.py 300 echo "- MZ-MZ match: passed" >> "$GITHUB_STEP_SUMMARY" + - name: cross-play, the MZ with the Spectrum and the CPC (Python emulators) + run: | + build/venv/bin/pip install -q "zx==$ZX_EMU_VERSION" "z80==$Z80_EMU_VERSION" numpy pillow + for pair in "mz zx" "zx mz" "mz cpc" "cpc zx"; do + echo "== $pair"; tools/ci/retry.sh build/venv/bin/python tools/crossplay.py 300 $pair | tail -3 + echo "- cross-play $pair: passed" >> "$GITHUB_STEP_SUMMARY" + done - if: failure() run: tail -n 50 build/relay.log build/mz800emu.log || true From edf8f2463f08e5c5b81b2428ac19ed88627273a2 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 20:02:23 +0200 Subject: [PATCH 15/17] CI: the emulator tests on every pull request and push to main as well as nightly (nightly.yml becomes emulators.yml); the MZ-800's cross-play pairs as parallel jobs Co-Authored-By: Claude Opus 5.5 --- .../workflows/{nightly.yml => emulators.yml} | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) rename .github/workflows/{nightly.yml => emulators.yml} (90%) diff --git a/.github/workflows/nightly.yml b/.github/workflows/emulators.yml similarity index 90% rename from .github/workflows/nightly.yml rename to .github/workflows/emulators.yml index d79ca39..9e336c1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/emulators.yml @@ -1,25 +1,27 @@ # The real emulators, in real time, under Xvfb: what the deterministic tests -# (test.yml) cannot show. Every night on main, by hand (Actions, "Run -# workflow"), and on a pull request labelled full-test or one that changes -# this workflow or tools/ci. Not a required check: an emulator in real time -# on a shared machine can stumble, so each test gets a second chance -# (tools/ci/retry.sh) and the run's summary lists what passed. -name: nightly +# (test.yml) cannot show. On every pull request and push to main, and every +# night (a new runner image, browser or package breaks things with no commit +# of ours). An emulator in real time on a shared machine can stumble, so each +# test gets a second chance (tools/ci/retry.sh) and the run's summary lists +# what passed. The deterministic ones (the MZ-800's replays and its matches +# with the Python emulators) are required checks; the real-time ones become +# required once they have shown they do not fail on their own. +name: emulators on: + pull_request: + push: + branches: [main] schedule: - cron: '17 2 * * *' workflow_dispatch: - pull_request: - types: [opened, synchronize, reopened, labeled] - paths: ['.github/workflows/nightly.yml', 'tools/ci/**'] defaults: run: shell: bash concurrency: - group: nightly-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: @@ -30,7 +32,6 @@ jobs: pc: name: PC in DOSBox-X runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -94,7 +95,6 @@ jobs: web: name: browser in Chrome runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -129,7 +129,6 @@ jobs: st: name: Atari ST in Hatari runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -172,7 +171,6 @@ jobs: amiga: name: Amiga in FS-UAE runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' env: AMIGA_MODEL: A1200 # FS-UAE's own AROS ROM (no download); on an A500 it crashed in a match steps: @@ -201,7 +199,6 @@ jobs: c64: name: C64 in VICE runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' steps: - uses: actions/checkout@v4 - name: toolchain versions @@ -260,9 +257,12 @@ jobs: timeout 20 ~/vice-dist/bin/x64sc +logcolorize -default -sounddev dummy -limitcycles 2000000 2>&1 | tail -40 || true mz: - name: MZ-800 in mz800emu + name: MZ-800 in mz800emu, ${{ matrix.test }} runs-on: ubuntu-24.04 - if: github.event_name != 'pull_request' || github.event.action != 'labeled' || github.event.label.name == 'full-test' + strategy: + fail-fast: false + matrix: # the cross-play matches side by side (one after another: 12 minutes) + test: [replays and a match, mz zx, zx mz, mz cpc, cpc zx] env: MZ800EMU: /home/runner/mz800emu/bin/mz800emu MZ800EMU_CFG: build/emucfg_net @@ -317,20 +317,21 @@ jobs: tools/ci/displays.sh tools/ci/relay.sh - name: replays + if: matrix.test == 'replays and a match' run: | for r in tests/recordings/*.bnr; do echo "== $r"; build/venv/bin/python tools/replay.py "$r" | tail -1; done echo "- MZ-800 replays: passed" >> "$GITHUB_STEP_SUMMARY" - name: match through the relay + if: matrix.test == 'replays and a match' run: | tools/ci/retry.sh build/venv/bin/python tools/lockstep_test.py 300 echo "- MZ-MZ match: passed" >> "$GITHUB_STEP_SUMMARY" - - name: cross-play, the MZ with the Spectrum and the CPC (Python emulators) + - name: cross-play, ${{ matrix.test }} (the Spectrum and the CPC in the Python emulators) + if: matrix.test != 'replays and a match' run: | build/venv/bin/pip install -q "zx==$ZX_EMU_VERSION" "z80==$Z80_EMU_VERSION" numpy pillow - for pair in "mz zx" "zx mz" "mz cpc" "cpc zx"; do - echo "== $pair"; tools/ci/retry.sh build/venv/bin/python tools/crossplay.py 300 $pair | tail -3 - echo "- cross-play $pair: passed" >> "$GITHUB_STEP_SUMMARY" - done + tools/ci/retry.sh build/venv/bin/python tools/crossplay.py 300 ${{ matrix.test }} | tail -3 + echo "- cross-play ${{ matrix.test }}: passed" >> "$GITHUB_STEP_SUMMARY" - if: failure() run: tail -n 50 build/relay.log build/mz800emu.log || true From 8b2223dc4712882fbe476e96dd7d280efd0e4752 Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 20:27:15 +0200 Subject: [PATCH 16/17] CI: the Atari XL/XE replay in atari800 (its built-in AltirraOS), the verdict read from the border's colour (tools/atari_test.py) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/emulators.yml | 35 ++++++++++++++++++ tools/atari_test.py | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100755 tools/atari_test.py diff --git a/.github/workflows/emulators.yml b/.github/workflows/emulators.yml index 9e336c1..6c61ec0 100644 --- a/.github/workflows/emulators.yml +++ b/.github/workflows/emulators.yml @@ -256,6 +256,41 @@ jobs: ldd ~/vice-dist/bin/x64sc | grep 'not found' || true timeout 20 ~/vice-dist/bin/x64sc +logcolorize -default -sounddev dummy -limitcycles 2000000 2>&1 | tail -40 || true + atari: + name: Atari XL/XE in atari800 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: sdk + with: + path: ~/llvm-mos + key: llvm-mos-${{ env.LLVM_MOS_VERSION }} + - name: llvm-mos SDK + if: steps.sdk.outputs.cache-hit != 'true' + run: | + curl -sSL -o /tmp/llvm-mos.tar.xz \ + "https://github.com/llvm-mos/llvm-mos-sdk/releases/download/$LLVM_MOS_VERSION/llvm-mos-linux.tar.xz" + tar -xJf /tmp/llvm-mos.tar.xz -C ~ + - name: atari800 (its built-in AltirraOS), the displays + run: | + sudo apt-get update -q + sudo apt-get install -y -q atari800 xvfb x11-utils ffmpeg python3-pil + tools/ci/displays.sh + - name: replay + run: | + LLVM_MOS=$HOME/llvm-mos python3 tools/build_atari.py --test tests/recordings/dm4.bnr + tools/ci/retry.sh python3 tools/atari_test.py + echo "- Atari replay: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + uses: actions/upload-artifact@v4 + with: + name: atari-failure + path: build/atari/test.png + retention-days: 7 + mz: name: MZ-800 in mz800emu, ${{ matrix.test }} runs-on: ubuntu-24.04 diff --git a/tools/atari_test.py b/tools/atari_test.py new file mode 100755 index 0000000..4295f9a --- /dev/null +++ b/tools/atari_test.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Run an ATARI_TEST build (tools/build_atari.py --test) in atari800 and read +its verdict: the build replays its recording from the title on, checks every +hash, and at the end turns the border green (all equal), yellow (all equal, +some frames over 60 ms of the emulated machine's time) or red (a hash +differed, from that frame on). The border is read from a screenshot. + + tools/atari_test.py [build/atari/bomber.xex] [--png out.png] + +atari800 (Ubuntu's package; ATARI800 to name another) as an 800XL, PAL, with +its built-in AltirraOS (no ROM to download), fast-forwarded, on the X display +AMIGA_DISPLAY (an Xvfb, :97), with a configuration of its own.""" +import os, subprocess, sys, time +from PIL import Image + +ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) +args = [a for i, a in enumerate(sys.argv[1:], 1) if not a.startswith('--') and sys.argv[i - 1] != '--png'] +xex = args[0] if args else os.path.join(ROOT, 'build', 'atari', 'bomber.xex') +out = os.path.join(ROOT, 'build', 'atari') +png = sys.argv[sys.argv.index('--png') + 1] if '--png' in sys.argv else os.path.join(out, 'test.png') +cfg = os.path.join(out, 'atari800.cfg') # never the user's ~/.atari800.cfg +open(cfg, 'w').write('') +env = dict(os.environ, DISPLAY=os.environ.get('AMIGA_DISPLAY', ':97')) # the invisible X display, never the desktop's +cmd = [os.environ.get('ATARI800', 'atari800'), '-config', cfg, '-no-autosave-config', '-xl', '-xl-rev', 'altirra', '-pal', + '-nobasic', '-nosound', '-windowed', '-turbo', '-run', xex] +log = open(os.path.join(out, 'atari800.log'), 'w') +p = subprocess.Popen(cmd, stdout=log, stderr=subprocess.STDOUT, env=env) +t0 = time.time() + + +def border(): + """the border's colour (just inside the window's top left corner), or None before the window shows""" + shot = png + '.part.png' + subprocess.run(['ffmpeg', '-loglevel', 'error', '-y', '-f', 'x11grab', '-video_size', '1024x768', '-i', env['DISPLAY'], + '-frames:v', '1', shot], env=env) + if not os.path.exists(shot): return None + os.replace(shot, png) + im = Image.open(png).convert('RGB') + box = im.getbbox() + return im.getpixel((box[0] + 4, box[1] + 4)) if box else None + + +def verdict(c): + """black (still playing: COLOR4 is 0 in the game), red, green or yellow (by hue)""" + if c is None or max(c) < 40: return None + r, g, b = c + if r > g * 1.5 and r > b: return 'red' + if g > r * 1.2: return 'green' + return 'yellow' + + +v = None +try: + while time.time() - t0 < 120 and p.poll() is None: + time.sleep(1) + v = verdict(border()) + if v: + time.sleep(1); v = verdict(border()) # a frame later: the figures drawn too + break +finally: + p.kill() +if not v: sys.exit(f'no verdict after {time.time() - t0:.0f} s (log: build/atari/atari800.log, screen: {png})') +print(f'{os.path.basename(xex)}: hashes {"MISMATCH" if v == "red" else "all equal"}' + f'{", some frames over 60 ms" if v == "yellow" else ""}; screenshot {png}; {time.time() - t0:.0f} s') +sys.exit(1 if v == 'red' else 0) From 18151d119e0381d61afb2d6d265c1c350f9e513f Mon Sep 17 00:00:00 2001 From: Martin Matyas Date: Sat, 24 Oct 2026 20:28:50 +0200 Subject: [PATCH 17/17] CI: cross-play between the browser and the PC, each one hosting Co-Authored-By: Claude Opus 5.5 --- .github/workflows/emulators.yml | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/emulators.yml b/.github/workflows/emulators.yml index 6c61ec0..5fb99e1 100644 --- a/.github/workflows/emulators.yml +++ b/.github/workflows/emulators.yml @@ -291,6 +291,55 @@ jobs: path: build/atari/test.png retention-days: 7 + cross: + name: cross-play, ${{ matrix.pair }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + pair: [web pc, pc web] # the browser (Chrome) and the PC (DOSBox-X), each one hosting + env: + CHROMIUM: google-chrome + CHROMIUM_FLAGS: --no-sandbox + steps: + - uses: actions/checkout@v4 + - name: toolchain versions + run: grep -v '^#' tools/ci/toolchains.env >> "$GITHUB_ENV" + - uses: actions/cache@v4 + id: ow + with: + path: ~/openwatcom + key: openwatcom-${{ env.OPENWATCOM_RELEASE }} + - name: OpenWatcom + if: steps.ow.outputs.cache-hit != 'true' + run: | + curl -sSL -o /tmp/ow.tar.xz \ + "https://github.com/open-watcom/open-watcom-v2/releases/download/$OPENWATCOM_RELEASE/ow-snapshot.tar.xz" + mkdir -p ~/openwatcom && tar -xJf /tmp/ow.tar.xz -C ~/openwatcom + - uses: actions/cache@v4 + id: emsdk + with: + path: ~/emsdk + key: emsdk-${{ env.EMSDK_VERSION }} + - name: Emscripten + if: steps.emsdk.outputs.cache-hit != 'true' + run: | + git clone -q https://github.com/emscripten-core/emsdk.git ~/emsdk + ~/emsdk/emsdk install "$EMSDK_VERSION" && ~/emsdk/emsdk activate "$EMSDK_VERSION" + - name: DOSBox-X, the displays, the relay + run: | + sudo apt-get update -q + sudo apt-get install -y -q dosbox-x xvfb x11-utils xdotool ffmpeg + tools/ci/displays.sh + tools/ci/relay.sh + build/venv/bin/pip install -q numpy websockets pillow "zx==$ZX_EMU_VERSION" "z80==$Z80_EMU_VERSION" # (crossplay.py imports every machine) + - name: the match + run: | + WATCOM=~/openwatcom EMSDK=~/emsdk tools/ci/retry.sh build/venv/bin/python tools/crossplay.py 300 ${{ matrix.pair }} | tail -3 + echo "- cross-play ${{ matrix.pair }}: passed" >> "$GITHUB_STEP_SUMMARY" + - if: failure() + run: tail -50 build/relay.log || true; tail -30 build/chromium.log || true + mz: name: MZ-800 in mz800emu, ${{ matrix.test }} runs-on: ubuntu-24.04