Skip to content

ci(replay-tests): add per-platform headless replay regression tests#125

Merged
fbraz3 merged 3 commits into
mainfrom
feat/ci-replay-tests
May 7, 2026
Merged

ci(replay-tests): add per-platform headless replay regression tests#125
fbraz3 merged 3 commits into
mainfrom
feat/ci-replay-tests

Conversation

@fbraz3

@fbraz3 fbraz3 commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

Adds automated deterministic replay regression tests to CI. After each successful ZH build, the pipeline downloads the built artifact, fetches encrypted game assets and platform-specific replay files, and runs every replay headlessly — failing CI if any replay exits non-zero.


New: .github/workflows/replay-tests.yml

Reusable workflow called per platform with inputs:

  • platform: linux or macos
  • game-artifact: artifact name from the upstream build job
  • ASSETS_KEY secret: password for the encrypted generalszh.7z

What each run does

  1. Downloads the built binary artifact (linux-generalsxzh-linux64-bundle or macos-generalsxzh-app)
  2. Checks out fbraz3/generalsx-test-files (via LFS) and extracts generalszh.7z with ASSETS_KEY
  3. Checks out fbraz3/GeneralsXReplays and installs:
    • Custom maps → user data Maps/ dir (includes MapCache.ini)
    • Platform replays (linux_*.rep / macos_*.rep) → user data Replays/ dir
  4. Runs each replay with -headless -replay <path> and collects pass/fail
  5. Reports results in the GitHub Step Summary table

Platform specifics

Linux:

  • Installs mesa-vulkan-drivers (lavapipe) — software Vulkan, no GPU required
  • LD_LIBRARY_PATH set to the bundle root (flat .so layout)
  • VK_ICD_FILENAMES forced to lavapipe ICD

macOS:

  • Uses MoltenVK already bundled inside the .app artifact — no Vulkan SDK install needed
  • VK_ICD_FILENAMES / VK_DRIVER_FILES pointed at bundled MoltenVK_icd.json
  • CNC_GENERALS_ZH_PATH set to the bin/ dir alongside the extracted assets

Changes to ci.yml

Job Trigger Tests
replay-test-linux After build-linux-gzip succeeds linux_*.rep vs Linux binary
replay-test-macos After build-macos succeeds macos_*.rep vs macOS binary

ci-summary updated to report replay results and fail CI on regressions.


Notes

  • Only ZH (GeneralsMD) is tested — Generals base has no replays yet
  • Cross-platform replay compatibility (recording on one OS, playing on another) is a known future work item, not tested here
  • The ASSETS_KEY secret must be set in the repository secrets for asset extraction to work
  • fbraz3/generalsx-test-files and fbraz3/GeneralsXReplays must be accessible with the default GITHUB_TOKEN (public) or a PAT if private

fbraz3 added 3 commits May 7, 2026 12:12
Adds a new reusable workflow (replay-tests.yml) that runs deterministic
headless replay tests after each successful ZH build.

Setup per run:
- Downloads built binary artifact from the upstream build job
- Checks out fbraz3/generalsx-test-files and extracts game assets
  using the ASSETS_KEY secret (password-protected 7z, no raw assets)
- Checks out fbraz3/GeneralsXReplays and installs custom maps +
  platform-specific replays (linux_*.rep / macos_*.rep) to the
  standard user data directory

Linux specifics:
- Installs mesa-vulkan-drivers (lavapipe) for software Vulkan in CI
- Sets LD_LIBRARY_PATH to the bundle root (flat lib layout)
- Forces VK_ICD_FILENAMES to lavapipe ICD

macOS specifics:
- Uses MoltenVK bundled inside the .app artifact (no Vulkan SDK install)
- Sets VK_ICD_FILENAMES/VK_DRIVER_FILES to bundled MoltenVK_icd.json
- Sets CNC_GENERALS_ZH_PATH to the bin/ dir with extracted assets

ci.yml changes:
- replay-test-linux: runs after build-linux-gzip succeeds (ZH only)
- replay-test-macos: runs after build-macos succeeds (ZH only)
- ci-summary: updated to report replay test results and fail CI on
  replay regressions

Only ZH is tested (Generals base has no replays yet).
Cross-platform replay compatibility is a known future work item.
GitHub Actions checkout path must be under GITHUB_WORKSPACE. Replace
absolute /tmp checkout paths with workspace-relative directories for
assets and replay repositories.

Also install coreutils on macOS and use gtimeout for replay execution
on macOS runners.
The replay workflow inferred APP_RESOURCES from a discovered binary path,
which could resolve to an invalid location depending on tar layout.

Resolve .app first, then set:
- APP_RESOURCES=<app>/Contents/Resources
- GAME_DIR=<resources>/bin
- GAME_BIN=<resources>/bin/GeneralsXZH

Also add explicit validation with directory dumps for faster CI diagnosis.
@fbraz3 fbraz3 merged commit 8fdc93f into main May 7, 2026
12 checks passed
@fbraz3 fbraz3 deleted the feat/ci-replay-tests branch May 7, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant