Skip to main content

Configuration file

For the bot to work, you have three requirements. Two of those requirements are available here.

Here we will see the other requirement: The configuration file.

Composition of the file​

The configuration file is a json that must be saved in your repo as .github/unity-ci.json.

It brings a lot of configuration options.

The most out of the box minimum configuration required file available would be the following one:

{
"orgId": "your org id",
"projectId": "your project id",
"buildPlatform": "standalonewindows64",
"autoDetectUnityVersion": true,
"useClosestVersion": true,
"runTests": false,
"cleanBuild": false,
"version": 1
}

Configuration generator tool​

To provide some convience, we have build a configuration generator tool. This will give a form that helps building the file and has all the required options available. We encourage you to use this instead of writing the json file by yourself.

It is available here: Config generator.

Fields​

orgId​

Your organization ID, you can find it in the URL of Unity's developer dashboard: https://dashboard.unity3d.com/organizations/ORG-ID/projects/.

projectId​

Your project ID, you can find it as Project ID in the Project settings tab of your Project tab in the developers dashboard (NOT in the cloud build tab).

Here you can see the project id in the bottom right.

Project settings

It is also available in the URL: https://dashboard.unity3d.com/organizations/ORG-ID/projects/PROJECT-ID/overview

buildPlatform​

The platform to evaluate, the options are ios, android, webplayer, webgl, standaloneosxintel, standaloneosxintel64, standaloneosxuniversal, standalonewindows, standalonewindows64, standalonelinux, standalonelinux64, standalonelinuxuniversal.

If you don't fill this field, it will default to standalonewindows64.

unityVersion​

latest or a unity dot version with underscores (ex. 4_6_5).

Default: null.

autoDetectUnityVersion​

If it should autodetect the unity version. If false it will use the version set in unityVersion.

Default: true

useClosestVersion​

If auto detect is on, and the current version is not available yet, use the closest version possible. (Ex.: If 2019.2.11f is not available, use 2019.2.10f)

Default: true

runTests​

If the build should run the tests. Defaults to false.

failedTestFailsBuild​

Fail the build if one of the tests fails. Defaults to false.

preExportMethod, postExportMethod, preBuildScript & postBuildScript​

Scripts executed before or after the build starts. It's an optional parameter.

You can find more information about export methods here: UnityCloudBuildPreAndPostExportMethods.

scriptingDefineSymbols​

Scripting Define Symbols that should be configured for the build.

cleanBuild​

If the system should delete the library folder before every build. Defaults to false.

Note: the first build for every PR is always a clean build. If set to false, a second build will be a dirty one.

delayBeforeBuild​

How many seconds the build should delay before starting. Defaults to 0.

Example of a more complex configuration​

Here you can see a more elaborated configuration:

{
"orgId": "my-organization-id",
"projectId": "my-project-id",
"buildPlatform": "ios",
"preExportMethod": "Setup.PrepareBuild",
"preBuildScript": "Setup.UpdateDependencies",
"unityVersion": "2021_2_3",
"autoDetectUnityVersion": false,
"scriptingDefineSymbols": "DEBUG;CHEAT_MODE",
"runTests": true,
"failedTestFailsBuild": true,
"cleanBuild": false,
"delayBeforeBuild": 5,
"version": 1
}

This configuration will trigger a build for ios, where it will call the static method PrepareBuild inside the Setup class.

It will use Unity version 2021.2.3 instead of detecting it automatically.

It will add the DEBUG;CHEAT_MODE scripting define symbols and run the tests. If any test fails, the check will also fail.

And before every build it will wait for 5 seconds.