Skip to content

Commit

Permalink
Add docs for test runner (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKahr authored Dec 13, 2023
1 parent 8947ac2 commit c109c24
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/03-github/01-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ jobs:
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -168,6 +170,8 @@ jobs:
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -223,6 +227,8 @@ jobs:
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -316,6 +322,8 @@ jobs:
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
Expand Down
42 changes: 42 additions & 0 deletions docs/03-github/03-test-runner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,44 @@ Isolation mode to use for the Docker container when running on Windows. Can be o

_**required:** `false`_ _**default:** `"default"`_

#### containerRegistryRepository

Container registry and repository to pull the image from. Only applicable if `customImage` is not
set.

This allows you to host your own images and still leverage the logic to automatically determine the
editor version and target platform. Accepts images from other registries too, for example
`ghcr.io/namespace/imagename` for Github Container Registry.

_**required:** `false`_ _**default:** `"unityci/editor"`_

#### containerRegistryImageVersion

Container registry image version. Only applicable if `customImage` is not set.

This allows you to roll back the image version to a previous version if needed or even use your own
version numbering for custom built and maintained registries.

_**required:** `false`_ _**default:** `"3"`_

#### runAsHostUser

Run the container as the host user based on the file permissions of the cloned project that gets
mounted to the container. This is useful if you are using a self-hosted runner and need the
generated files from the container to be owned by the same user as the runner host. This solves most
permission errors without requiring the runner agent to run as root. This option shouldn't be needed
on Github Hosted runners as the systems are automatically wiped each run so we default to `false`.
Self-Hosted runners generally will want to set this to `true`.

_**required:** `false`_ _**default:** `false`_

#### chownFilesTo

User and optionally group (user or user:group or uid:gid) to give ownership of the resulting build
artifacts.

_**required:** `false`_ _**default:** `""`_

## Complete example

A complete workflow that tests all modes separately could look like this:
Expand Down Expand Up @@ -486,6 +524,8 @@ jobs:
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ${{ matrix.projectPath }}
testMode: ${{ matrix.testMode }}
Expand Down Expand Up @@ -536,6 +576,8 @@ jobs:
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
packageMode: true
projectPath: ${{ matrix.projectPath }}
Expand Down

0 comments on commit c109c24

Please sign in to comment.