|
| 1 | +# Unity EditMode/PlayMode gate |
| 2 | + |
| 3 | +Unity changes are not considered validated by the .NET suite alone. The exact |
| 4 | +candidate commit must pass both Unity EditMode and PlayMode using Unity |
| 5 | +`6000.5.6f1`. |
| 6 | + |
| 7 | +## Automated gate |
| 8 | + |
| 9 | +The `unity-tests` CI matrix contains independent `editmode` and `playmode` |
| 10 | +jobs. It is deliberately controlled by the repository variable |
| 11 | +`UNITY_CI_ENABLED`. |
| 12 | + |
| 13 | +Keep the variable set to `false` until these repository secrets contain valid |
| 14 | +Unity Personal or Professional CI credentials: |
| 15 | + |
| 16 | +- `UNITY_LICENSE`; |
| 17 | +- `UNITY_EMAIL`; |
| 18 | +- `UNITY_PASSWORD`. |
| 19 | + |
| 20 | +After replacing the placeholder values, set `UNITY_CI_ENABLED=true` and run the |
| 21 | +workflow manually or update a trusted branch. Confirm both jobs produce XML and |
| 22 | +log artifacts before making them required branch checks. |
| 23 | + |
| 24 | +Repository secrets are unavailable to pull requests from forks by design. Do |
| 25 | +not use `pull_request_target` to execute untrusted Unity project code with |
| 26 | +secrets. A maintainer must run the manual gate on the fork commit instead. |
| 27 | + |
| 28 | +## Manual gate |
| 29 | + |
| 30 | +From a clean checkout on macOS with Unity Hub Editor `6000.5.6f1` installed: |
| 31 | + |
| 32 | +```sh |
| 33 | +./scripts/sync-core-to-unity.sh |
| 34 | + |
| 35 | +UNITY_EDITOR=/Applications/Unity/Hub/Editor/6000.5.6f1/Unity.app/Contents/MacOS/Unity |
| 36 | +PROJECT_PATH="$PWD/src/HitTheKit.Unity" |
| 37 | +RESULT_ROOT="$PWD/artifacts/unity-tests" |
| 38 | +mkdir -p "$RESULT_ROOT" |
| 39 | + |
| 40 | +"$UNITY_EDITOR" -batchmode -projectPath "$PROJECT_PATH" \ |
| 41 | + -runTests -testPlatform EditMode \ |
| 42 | + -testResults "$RESULT_ROOT/editmode-results.xml" \ |
| 43 | + -logFile "$RESULT_ROOT/editmode.log" |
| 44 | + |
| 45 | +"$UNITY_EDITOR" -batchmode -projectPath "$PROJECT_PATH" \ |
| 46 | + -runTests -testPlatform PlayMode \ |
| 47 | + -testResults "$RESULT_ROOT/playmode-results.xml" \ |
| 48 | + -logFile "$RESULT_ROOT/playmode.log" |
| 49 | +``` |
| 50 | + |
| 51 | +Both commands must exit zero. Inspect the XML and logs rather than reporting |
| 52 | +only the process exit status. Record the commit SHA, operating system, Editor |
| 53 | +revision, architecture, totals, failures and skipped tests in the pull request. |
| 54 | + |
| 55 | +Documentation-only changes may state that Unity was not required. Runtime, |
| 56 | +scene, prefab, package, ProjectSettings, UXML, USS and Editor-tool changes must |
| 57 | +provide Unity evidence. |
| 58 | + |
| 59 | +## Activation boundary |
| 60 | + |
| 61 | +Never commit a Unity license file, account password or serial. Store credentials |
| 62 | +only as encrypted repository or environment secrets. Placeholder secrets are |
| 63 | +not valid credentials and the activation variable must remain `false` while |
| 64 | +they are present. |
0 commit comments