Skip to content

Commit 57c4c9c

Browse files
feat: scoped registries (#453)
* feat: scoped registries * feat: private scoped registries * Update docs/03-github/03-test-runner.mdx Co-authored-by: Gabriel Le Breton <[email protected]> * yarn lint --------- Co-authored-by: Gabriel Le Breton <[email protected]>
1 parent c3eff91 commit 57c4c9c

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

docs/03-github/03-test-runner.mdx

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,38 @@ the [`packageMode`](#packagemode) configuration option to `true`.
9494
packageMode: true
9595
```
9696

97+
#### Using a scoped registry
98+
99+
When testing a Unity package that has dependencies inside a scoped registry, you can set the
100+
[`scopedRegistryUrl`](#scopedRegistryUrl) and [`registryScopes`](#registryScopes) to ensure those
101+
depedencies can be resolved.
102+
103+
```yaml
104+
- uses: game-ci/unity-test-runner@v4
105+
with:
106+
scopedRegistryUrl: https://example.com/registry
107+
registryScopes: 'com.example, com.example.tools.physics'
108+
```
109+
110+
#### Authentication with a private scoped registry
111+
112+
If your package has dependencies that are hosted in a private UPM registry, then you will need to
113+
supply a valid authentication token for your registry as an environment variable. Setup the
114+
[`scopedRegistryUrl`](#scopedRegistryUrl) and [`registryScopes`](#registryScopes) as usual, but also
115+
include a `UPM_REGISTRY_TOKEN` when defining your Unity License.
116+
117+
```yaml
118+
- uses: game-ci/unity-test-runner@v4
119+
env:
120+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
121+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
122+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
123+
UPM_REGISTRY_TOKEN: ${{ secrets.UPM_REGISTRY_TOKEN }}
124+
with:
125+
scopedRegistryUrl: https://example.com/registry
126+
registryScopes: 'com.example'
127+
```
128+
97129
#### Passing a unityVersion
98130

99131
Make sure that you explicitly pass the [`unityVersion`](#unityversion) argument, as it's necessary
@@ -139,9 +171,6 @@ potential workarounds.
139171
- The test runner can only test packages on Linux runners - Windows runners are currently not
140172
supported (this issue is being tracked
141173
[here](https://github.com/game-ci/unity-test-runner/issues/224))
142-
- Packages with dependencies outside of the Unity Registry have not been tested an may or may not
143-
work with the test runner (this issue is being tracked
144-
[here](https://github.com/game-ci/unity-test-runner/issues/225)).
145174
- There is currently no caching set up for the testing of Unity packages (this issue is being
146175
tracked [here](https://github.com/game-ci/unity-test-runner/issues/226)).
147176
- If using the [`customImage`](#customImage) parameter to use a custom Docker image to test the
@@ -419,12 +448,31 @@ Whether the tests are being run for a Unity package instead of a Unity project.
419448
If true, the action can only be run on Linux runners, and any custom docker image passed to this
420449
action must have [`jq`](https://jqlang.github.io/jq/) installed.
421450

422-
NOTE: may not work properly for packages with dependencies outside of the Unity Registry.
451+
NOTE: packages with dependencies outside of the Unity Registry need to utilize the
452+
[`scopedRegistryUrl`](#scopedRegistryUrl) to resolve the dependencies correctly.
423453

424454
See [Testing Unity packages](#testing-unity-packages) for more information.
425455

426456
_**required:** `false`_ _**default:** `false`_
427457

458+
#### scopedRegistryUrl
459+
460+
The Url of the UPM registry to use for resolving package dependencies. Only applicable if
461+
packageMode is true. When setting this value, you must also provide
462+
[`registryScopes`](#registryScopes)
463+
464+
_**required:** `false`_ _**default:** `false`_
465+
466+
#### registryScopes
467+
468+
Defines the scopes of a registry and its associated packages, see
469+
[the Unity Documentation](https://docs.unity3d.com/Manual/upm-scoped.html]) for further information
470+
on scopes. Provide as a comma separated list, e.g. 'com.example, com.example.tools.physics'.
471+
472+
NOTE: Required if scopedRegistry is set, otherwise ignored.
473+
474+
_**required:** `false`_ _**default:** `false`_
475+
428476
#### dockerCpuLimit
429477

430478
Number of CPU cores to assign to the Docker container. Defaults to all available cores when no value

0 commit comments

Comments
 (0)