Problem
The unity-tests.yml workflow currently runs only on Unity 2021.3.45f2. Compile errors that are version-specific (e.g. anything that diverges between 2021.3 / 2022.3 / 6000.x APIs) slip through CI and only surface when end users update the package.
Two recent incidents illustrate this:
Proposal: tiered matrix
Run a fast PR matrix and a thorough push-to-beta matrix:
| Trigger |
Versions |
Wall-clock |
pull_request_target (current safe-to-test flow) + in-repo PRs |
2021.3.45f2 only |
~3 min |
push: branches: [beta] |
2021.3.45f2, 2022.3.x (latest LTS), 6000.x (latest 6 LTS) |
~6-8 min (parallel) |
| Optional nightly |
Widest matrix |
n/a |
Per-PR cost stays the same as today. Per-merge-to-beta cost goes up ~3× in runner minutes, but that fires far less frequently than PRs and the existing release-gating in #1103 already blocks PyPI/version-bump on test failure — so widening the matrix at the beta gate is exactly where it has the most leverage.
Implementation sketch
In .github/workflows/unity-tests.yml, switch the matrix to use include: and condition on github.event_name/github.ref:
strategy:
fail-fast: false
matrix:
include:
- { unityVersion: "2021.3.45f2", projectPath: "TestProjects/UnityMCPTests", testMode: "editmode" }
# Beta gate adds the wider matrix:
- { unityVersion: "2022.3.x", projectPath: "TestProjects/UnityMCPTests", testMode: "editmode" }
- { unityVersion: "6000.0.x", projectPath: "TestProjects/UnityMCPTests", testMode: "editmode" }
exclude:
- unityVersion: "2022.3.x"
# only run on push to beta or workflow_call from a release pipeline
- unityVersion: "6000.0.x"
# ditto
(The exact gating expression depends on which form actions/runner accepts in exclude:; a conditional skip inside the steps via if: ${{ matrix.unityVersion == '2021.3.45f2' || github.ref == 'refs/heads/beta' }} is more reliable.)
License/cost notes
game-ci/unity-test-runner reuses a single UNITY_LICENSE across parallel matrix entries within one workflow run. Per-job cost is just runner minutes (~3 min × N versions, parallelized), not extra license seats.
Acceptance criteria
Problem
The
unity-tests.ymlworkflow currently runs only on Unity2021.3.45f2. Compile errors that are version-specific (e.g. anything that diverges between 2021.3 / 2022.3 / 6000.x APIs) slip through CI and only surface when end users update the package.Two recent incidents illustrate this:
CaptureFromCameraToAssetsFolderrename gap. Caught at the merge boundary by post-merge tests on 2021.3 because it failed on every Unity, but Unity Tests was running in parallel with PyPI publish so the broken beta still shipped (now fixed by gating in fix: unblock beta compile and gate releases on test success #1103).UnityFindObjectsCompat2022.3 compile error. Not catchable by the current CI at all because the bug only manifests on Unity 2022.3.x; CI's lone runner is on 2021.3 where the legacy code path is taken. Patch is in fix: close 2022.3 compile gap in UnityFindObjectsCompat.FindAll #1106 but next equivalent regression will repeat unless we widen the matrix.Proposal: tiered matrix
Run a fast PR matrix and a thorough push-to-beta matrix:
pull_request_target(currentsafe-to-testflow) + in-repo PRs2021.3.45f2onlypush: branches: [beta]2021.3.45f2,2022.3.x(latest LTS),6000.x(latest 6 LTS)Per-PR cost stays the same as today. Per-merge-to-beta cost goes up ~3× in runner minutes, but that fires far less frequently than PRs and the existing release-gating in #1103 already blocks PyPI/version-bump on test failure — so widening the matrix at the beta gate is exactly where it has the most leverage.
Implementation sketch
In
.github/workflows/unity-tests.yml, switch the matrix to useinclude:and condition ongithub.event_name/github.ref:(The exact gating expression depends on which form
actions/runneraccepts inexclude:; a conditional skip inside the steps viaif: ${{ matrix.unityVersion == '2021.3.45f2' || github.ref == 'refs/heads/beta' }}is more reliable.)License/cost notes
game-ci/unity-test-runnerreuses a singleUNITY_LICENSEacross parallel matrix entries within one workflow run. Per-job cost is just runner minutes (~3 min × N versions, parallelized), not extra license seats.Acceptance criteria
MCPForUnity/Editor/**orTestProjects/UnityMCPTests/**still run a quick single-version test in CI.beta(and the existingworkflow_callfrombeta-release.yml/release.yml) run the wider matrix.update_unity_beta_versionandpublish_pypi_prereleasejobs.2022.3.xfloating tags in CI).