Behind the game
How Dune City is built and tested
Dune City is developed on one Mac mini, tested in GitHub Actions and on two on-demand AWS machines, and released from a pre-qualified, tagged commit. AI coding agents share a single staging checkout and a single build. A home-grown scheduler, dunecity-queue, fans test games and test suites out to the AWS workers and switches them off when the work is done.
As of 22 November 2026. The current stable release is 1.0.875, published 21 November 2026.
At a glance
Infrastructure
The Mac mini is the hub: it holds the source, runs the scheduler and signs releases. Everything else is rented or optional.
| Component | What it is | What it does in the pipeline |
|---|---|---|
| Mac mini | Apple M4, 10 cores, 16 GB, always on | Development host. Holds the staging checkout and its build, runs the queue scheduler, and is the self-hosted GitHub Actions runner (dunecity-builder) for Mac signing and notarising, iOS builds and release qualification. Also runs the four tests that need a real window or calibrated timing. |
| GitHub | Public repo dunecity-project/dunecity | Source of record, four Actions workflows, and GitHub Releases for staging and stable packages. |
| GitHub-hosted runners | Ubuntu, Windows Server 2022, macOS 15 | Build and test each platform on every integration push: Linux, Windows, macOS and the browser (WebAssembly via Emscripten). |
AWS worker aws | c8g.8xlarge Graviton (32 vCPU), Ubuntu 24.04 arm64, Sydney, Spot | 32 game slots and the Linux reference build. Off unless a job needs it. |
AWS worker aws-mel2 | c8g.16xlarge Graviton (64 vCPU), Melbourne, Spot | 96 game slots. Off unless a job needs it. |
| CloudWatch alarms | One per AWS worker | Backstop: stop a worker whose CPU stays under 1% for 15 minutes, in case the scheduler is down. |
| Guest workers | A MacBook Pro, a MacBook Air and a Windows PC | Optional extra capacity, never required. AWS carries the load. |
| Website server | One Apache host serving dunelegacy.com | Hosts this website, the browser build (/play and /play-staging) and the multiplayer signalling and relay services. |
| SourceForge | Files mirror | Second download location, synced automatically after a stable release. |
| Secrets | A password manager and GitHub Actions secrets | Hold SSH keys, cloud tokens and signing credentials. Nothing secret lives in the repo. |
Development workflow
All work lands in one checkout and one build, so every agent tests the same binary.
- Edit. Coding agents (Claude Code, Codex and OMP) work in the staging checkout on branch
integrate/feature-batch. Each claims the files it will touch, so two agents never edit the same file. - Build. There is one build tree: CMake and Ninja, C++17, libraries from Homebrew, compiler output cached by ccache. A shared lock allows only one build, local test run or Git change at a time.
- Switch. Any change to AI or game behaviour goes behind an on/off config switch. Tests then compare OFF and ON in the same binary instead of building one tree per idea.
- Commit and test. Tests run against a committed, full SHA, never the working tree. Headless tests go to the AWS queue; only the Mini-only tests run locally.
- Integrate. One integrator combines accepted changes and pushes the batch to GitHub, which starts CI.
The stack is a C++17 and SDL2 game engine, Python for test harnesses and packaging, Emscripten for the browser build, and Node and PHP for the multiplayer services. CI builds get their libraries from vcpkg rather than Homebrew.
Test frameworks and gates
CTest is the single registry: 242 tests, each labelled by what it needs (headless or gui) and by tier. 238 are headless and run on Linux; 4 need a real Mac window and stay on the Mini.
| Layer | Framework or tool | What it checks | Where it runs |
|---|---|---|---|
| Unit tests | Catch2 v3, one binary (dunelegacy_tests), about 100 suites | Game rules, AI policies, network protocol, save compatibility | AWS, hosted Linux CI, any dev machine |
| Headless game probes | Python drivers plus small C++ probes compiled against the real engine, run on SDL's dummy video driver | Menus, skirmish, save and load, unit behaviour, pathfinding, multiplayer commands | AWS, through dunecity-queue ctest |
| AI regression gates | Python harnesses that play full AI-versus-AI games on fixed seeds (run-all-against-atreides.py, scenario-matrix.py, run-ffa-army-deploys.py) | The AI must still win, or deploy its army, inside fixed game-time limits. Mandatory for every AI or unit change. | AWS |
| AI research matches | formation-duel.py, vanilla-match.py and scenario-matrix.py, scored by match_score.py | Whether a candidate (switch ON) beats the control (switch OFF). It becomes the default only if the 95% interval of the paired score difference is above zero. | AWS, through dunecity-queue submit, one game per slot |
| Performance | perf_regression | Simulation CPU per game cycle and AI update time, against budgets calibrated on the Mini | Mini only |
| Native GUI and input | Pointer-mapping and mouse-control probes, GPU renderer tests | Real window, real mouse events, accelerated renderer | Mini only |
| Multiplayer services | npm test for the room relay, Python unittest driving the real PHP signalling service, Node scripts comparing native and browser message framing | Relay, signalling and native-to-browser protocol agreement | Hosted Linux CI; two PHP network probes also run on AWS |
| Release tooling | Python unittest under scripts/tests | Update feeds, packaging, release automation, qualification routing | Hosted Linux CI |
Three tiers decide how much runs. integration (56 tests) is the quick gate on every change. nightly (all 242) is the broad regression run and collects every result rather than stopping at the first failure. release-smoke checks the actual packaged app before a release.
AWS test queue
Accepted is not passed: the result comes from dunecity-queue report JOB --follow.
Two commands cover most use. dunecity-queue ctest --rev SHA --machines aws aws-mel2 -L integration runs registered tests, and dunecity-queue submit --rev SHA -- python3 tests/ai/vanilla-match.py ... plays a batch of AI games.
Release path
A release is a commit that has already passed qualification, tagged and then published channel by channel.
- CI. Every push to
integrate/feature-batchruns the Build Dune Legacy workflow: tests on Linux, plus Windows, macOS, Linux and browser builds. - Staging packages. A green batch becomes an immutable staging pre-release on GitHub (two-hour debounce, daily safety net). Staging builds carry a
devversion label, never become Latest, and their browser copy goes to/play-staging, separate from the stable/play. - Qualification. Green CI also triggers Qualify release candidate: the broad nightly headless suite, once per frozen commit, on the Mini with a GitHub-hosted Mac as fallback. On the Mini it sends its test games to AWS.
- Tag. Pushing
vX.Y.Zbuilds the official packages. The Mini signs and notarises the Mac build and signs the update feeds. - Publish. The release job publishes to GitHub; SourceForge and the browser build follow automatically. A channel counts as done only after its live destination is checked.
| Channel | How it is produced |
|---|---|
| Windows, macOS, Linux | Tag build on GitHub Releases: Windows EXE and ZIP, macOS DMG and ZIP, Linux AppImage, DEB, RPM and tar.gz |
| SourceForge | Sync SourceForge release workflow, automatic after the stable build |
| Browser | Publish browser build workflow commits to the website repo, which then deploys to the web server |
| Website | Links and changelog updated by the release job; the "New in" text is written by hand |
| iPhone and iPad | scripts/build-ios.sh --testflight on the Mini, then TestFlight review |
| Android | Separate version line; needs the existing upgrade signing key, a phone test and explicit approval to publish |
Where things live
| What | Where |
|---|---|
| Game source and CI | dunecity-project/dunecity; workflows in .github/workflows/ (build.yml, qualify-release.yml, web.yml, sourceforge.yml) |
| Integration branch | integrate/feature-batch; stable releases are tagged vX.Y.Z |
| Test registration and labels | tests/CMakeLists.txt; AI harnesses in tests/ai/ |
| Release runbook | docs/release-operations.md |
| Which test runs where, and why | docs/ai-scenario-matrix.md, section "Where the gates run" |
| Mac signing runner | docs/macos-release-runner.md |
| Queue scheduler and workspace rules | On the Mac mini, outside the game repo |
