Testing & CI
Local checks
Section titled “Local checks”composer installcomposer lint # php -l on every app file; fails on syntax errors AND deprecationscomposer test # PHPUnit unit tests (no database needed)Unit tests live in tests/Unit and use a light bootstrap (tests/bootstrap.php) that autoloads app
models without booting the framework.
End-to-end smoke test
Section titled “End-to-end smoke test”tests/smoke.sh drives a real, freshly started stack the way a new user would:
/redirects to/setup- the wizard rejects invalid input, then installs the game
- setup locks itself
- the new admin logs in
- 18 game and Cardinal pages return
200 /profileopens your own profile, unknown players get a 404, and old/hacker/...URLs redirect- a mission starts and the mission interface renders
- cron endpoints accept the right hash and reject a wrong one
docker compose down -v # start from an empty databasedocker compose up -d --build --waittests/smoke.sh http://localhost:8080GitHub Actions
Section titled “GitHub Actions”| Workflow | Trigger | What it does |
|---|---|---|
ci.yml |
push / PR to master |
Lint + PHPUnit + composer audit on PHP 8.5; builds the Docker stack and runs the smoke test |
docker.yml |
push to master, v* tags |
Builds amd64 + arm64 images and pushes them to ghcr.io (latest, version and SHA tags) |
release.yml |
v* tags |
Builds standalone .zip / .tar.gz archives with all dependencies, then publishes a GitHub Release (Latest, or pre-release for -rc style tags) |
docs-pages.yml |
changes under docs/ or images/ |
Builds this site with Astro and deploys it to GitHub Pages |
Documentation site
Section titled “Documentation site”The docs are an Astro + Starlight project in
docs/. Pages are Markdown/MDX files in docs/src/content/docs/.
cd docsnpm installnpm run dev # http://localhost:4321/secret-republic-browser-based-cyber-security-rpg-v4/npm run build # static site in docs/dist (includes sitemap and search index)Every page needs a title and a descriptive description in its front matter. Starlight uses them for
the <title>, meta description, Open Graph tags and search results.
