A project could only be played inside the editor, behind the login.
To show a game to someone else there was no way short of an account.
A release freezes the saved project under a random token and serves
it on a page that holds nothing but the game view.
- Menu -> Release... opens a dialog with the state of the release,
the link with Copy link and Open, Publish or Update release, and
Take down behind a confirmation.
- Publish saves first and refuses while anything is unsaved, like
snapshots. Updating keeps the link. Take down kills it, and a new
Publish hands out a new token.
- The link is play.html?game=<32 hex>. The page needs no session,
paints Theme.colors.background, zooms with Auto and waits for
"Click to play" so that sound and keyboard focus are allowed.
- The game always starts in the start scene. Persistent variables
are stored per link in the browser. Plugins are not loaded, and the
dialog warns about them and about a project without a scene.
- GET ?r=releases/{token} is the only route besides auth/* that works
without a login. The public answer carries the token as project.id,
so the project id stays hidden. Release files are written with 0640
and nginx does not serve them directly (measured 403).
- Starting, the frame and Load scene moved into runtime/GameRun.ts.
Play in the editor and the play page run through the same code.
- WorldViewport moved to src/viewport/ and no longer needs the
EditorState. Pointer forwarding (gamePointer.ts) and setting up
textures, fonts and sounds (projectFiles.ts) exist only once.
- Vite builds two pages. The play page loads 4 kB of its own code
plus the shared chunk (Pixi, runtime, drawing, 653 kB) and Rapier,
without the editor.
Found on the way, not fixed here: data/projects/<id>.json answers 200
without a login because the files are 0644.
Tests:
- ./check.sh: 194 files, 2808 tests, exit 0.
- tests/php/releases.test.php: 20 checks, also added to CI.
- New e2e module 60 with 10 checks, played in a browser without a
session. Module 46 counts the menu entries and was updated.
- Full e2e run: 1572 checks passed.
- Counter-checks: 3 unit, 2 PHP and 3 browser mutations all fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
67 lines
2.0 KiB
YAML
67 lines
2.0 KiB
YAML
# Runs the whole proof on the Gitea runner: gate, the editor suite and the three example games.
|
||
#
|
||
# `runs-on: game-maker-ci` picks the image built from tools/ci/Dockerfile. The render device and
|
||
# /dev/shm come from the runner's own container.options (/_stacks/git/runner/config.yaml), not
|
||
# from here – without them chromium falls back to software WebGL.
|
||
#
|
||
# Two jobs without `needs:`, so they start together and use both slots of the runner
|
||
# (`capacity: 2`, four cores). The gate no longer stands in front of the suite: a lint error used
|
||
# to cost the full e2e run before it was reported, and the run reported it after six minutes
|
||
# instead of one. Both still have to pass for the push to be green.
|
||
#
|
||
# The price is contention: while the gate runs, vitest and chromium share the four cores, and the
|
||
# suite measures text widths and frame counts. That is why the gate caps vitest at two workers
|
||
# (GM_TEST_WORKERS) – two cores stay free for the browser for the whole overlap.
|
||
name: game-maker
|
||
|
||
on:
|
||
push:
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
gate:
|
||
runs-on: game-maker-ci
|
||
timeout-minutes: 20
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Install
|
||
run: npm ci --no-audit --no-fund
|
||
|
||
- name: Gate
|
||
run: ./check.sh
|
||
env:
|
||
GM_TEST_WORKERS: 2
|
||
|
||
# The API's own rules (#180, #179, #231, #266). Not part of check.sh: the host the editor is built
|
||
# on has no PHP, the image does.
|
||
- name: PHP tests
|
||
run: |
|
||
php tests/php/accounts.test.php
|
||
php tests/php/snapshots.test.php
|
||
php tests/php/releases.test.php
|
||
|
||
suite:
|
||
runs-on: game-maker-ci
|
||
timeout-minutes: 45
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Versions
|
||
run: |
|
||
node --version
|
||
chromium --version
|
||
php --version | head -1
|
||
|
||
- name: Install
|
||
run: npm ci --no-audit --no-fund
|
||
|
||
- name: Build
|
||
run: npm run build
|
||
|
||
- name: Editor suite
|
||
run: tools/ci/run-e2e.sh
|
||
|
||
- name: Example games
|
||
run: tools/ci/run-smokes.sh
|