Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions .github/workflows/build-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ on:

jobs:
build-unity:
if: ${{ (github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:') }}
if: ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
strategy:
fail-fast: false
matrix:
unity: ["2019.3.9f1", "2019.4.13f1", "2020.1.12f1"]
unity: ["2021.3.41f1", "2022.3.39f1", "6000.0.12f1"] # Test with LTS
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
Expand All @@ -28,10 +29,29 @@ jobs:
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"

- uses: actions/checkout@v3
# Execute scripts: RuntimeUnitTestToolkit(Linux64/Mono2x)
- uses: actions/checkout@v4

# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypacakge)
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
with:
projectPath: RuntimeUnitTestToolkit
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export

- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
with:
directory: RuntimeUnitTestToolkit

# Execute Unittest
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
- name: Build UnitTest(Linux64, mono)
- name: Build UnitTest
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
Expand All @@ -42,13 +62,17 @@ jobs:
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: UnitTestBuilder.BuildUnitTest
customParameters: /headless /ScriptBackend Mono2x
customParameters: "/headless /ScriptBackend Mono2x"
- name: Check UnitTest file is generated
run: ls -lR ./RuntimeUnitTestToolkit/bin/UnitTest
- name: Execute UnitTest
run: ./RuntimeUnitTestToolkit/bin/UnitTest/StandaloneLinux64_Mono2x/test

# Execute scripts: Export Package
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
- name: Build Unity (.unitypacakge)
- name: Remove Library
run: sudo rm -rf ./RuntimeUnitTestToolkit/Library

# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
- name: Build UnitTest
uses: Cysharp/Actions/.github/actions/unity-builder@main
env:
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
Expand All @@ -58,8 +82,16 @@ jobs:
projectPath: RuntimeUnitTestToolkit
unityVersion: ${{ matrix.unity }}
targetPlatform: StandaloneLinux64
buildMethod: PackageExporter.Export
buildMethod: UnitTestBuilder.BuildUnitTest
customParameters: "/headless /ScriptBackend IL2CPP"
- name: Check UnitTest file is generated
run: ls -lR ./RuntimeUnitTestToolkit/bin/UnitTest
- name: Execute UnitTest
run: ./RuntimeUnitTestToolkit/bin/UnitTest/StandaloneLinux64_IL2CPP/test

- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
# Store artifacts.
- uses: Cysharp/Actions/.github/actions/upload-artifact@main
with:
directory: RuntimeUnitTestToolkit
name: RuntimeUnitTestToolkit.${{ matrix.unity }}.unitypackage.zip
path: ./RuntimeUnitTestToolkit/*.unitypackage
retention-days: 1
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ needs.update-packagejson.outputs.sha }}
# Execute scripts: Export Package
Expand Down
25 changes: 9 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _ReSharper*
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
Expand Down Expand Up @@ -105,22 +105,15 @@ Generated_Code #added for RIA/Silverlight projects
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
.vs/config/applicationhost.config
.vs/restore.dg
.vs

# Unity
RuntimeUnitTestToolkit/bin/*
.vsconfig
RuntimeUnitTestToolkit/Library/*
RuntimeUnitTestToolkit/obj/*
RuntimeUnitTestToolkit/Temp/*
RuntimeUnitTestToolkit/.vs/
RuntimeUnitTestToolkit/UpgradeLog.htm
RuntimeUnitTestToolkit/RuntimeUnitTestToolkit.unitypackage

RuntimeUnitTestToolkit/Assembly-CSharp-Editor.csproj

RuntimeUnitTestToolkit/RuntimeUnitTestToolkit.csproj

RuntimeUnitTestToolkit/RuntimeUnitTestToolkit.sln

RuntimeUnitTestToolkit/Tests.csproj
RuntimeUnitTestToolkit/Logs/*
RuntimeUnitTestToolkit/[Uu]ser[Ss]ettings/
RuntimeUnitTestToolkit/*.sln
RuntimeUnitTestToolkit/*.csproj
RuntimeUnitTestToolkit/*.unitypackage
!RuntimeUnitTestToolkit/Packages/
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,24 @@ For example, this library's CI(GitHub Actions) itself.
run: ./RuntimeUnitTestToolkit/bin/UnitTest/StandaloneLinux64_Mono2x/test
```

```yml
# Execute scripts: RuntimeUnitTestToolkit(Linux64/IL2CPP)
- name: Build UnitTest(Linux64, il2cpp)
run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
working-directory: RuntimeUnitTestToolkit

# Execute player:
- name: Execute UnitTest
run: ./RuntimeUnitTestToolkit/bin/UnitTest/StandaloneLinux64_IL2CPP/test
```

You can invoke `-executeMethod UnitTestBuilder.BuildUnitTest` and some options.

| Command | Desc |
| --- | --- |
| **/headless** | Boolean switch, build CLI mode. Default is false. |
| **/scriptBackend** ScriptingImplementation | Enum string(`Mono2x` or `IL2CPP` or `WinRTDotNET` )|
| **/buildTarget** BuildTarget |Enum string(`StandaloneWindows64`, `StandaloneLinux64`, `StandaloneOSX`, `iOS`, `Android`, etc...) |
| **/buildTarget** BuildTarget |Enum string(`StandaloneWindows64`, `StandaloneLinux64`, `StandaloneOSX`, `iOS`, `Android`, etc...) |
| **/buildPath** FilePath | String path. Default is `bin/UnitTest/{BuildTarget}_{ScriptBackend}/test`(If windows `test.exe`, Android `test.apk`, OSX `test.app`) |

You can pass by `/` prefix.
Expand Down Expand Up @@ -116,7 +127,7 @@ Advanced

`/headless` argument offer CUI player, therefore user can handle stdout/stderr and ExitCode on CI.

However you will find it's not for StandaloneOSX. `BuildUnitTest` on StandaloneOSX generate `.app` but you cannot get any output or ExitCode with `open -a xxxx.app`
However you will find it's not for StandaloneOSX. `BuildUnitTest` on StandaloneOSX generate `.app` but you cannot get any output or ExitCode with `open -a xxxx.app`
Let's see what going on with this repository's UnitTest.

```shell
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions RuntimeUnitTestToolkit/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"dependencies": {
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.33",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9",
"com.unity.ugui": "1.0.0"
}
}
100 changes: 100 additions & 0 deletions RuntimeUnitTestToolkit/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"dependencies": {
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.31",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.22",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "2.0.10",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.9",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
}
}
}
35 changes: 35 additions & 0 deletions RuntimeUnitTestToolkit/ProjectSettings/MemorySettings.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!387306366 &1
MemorySettings:
m_ObjectHideFlags: 0
m_EditorMemorySettings:
m_MainAllocatorBlockSize: -1
m_ThreadAllocatorBlockSize: -1
m_MainGfxBlockSize: -1
m_ThreadGfxBlockSize: -1
m_CacheBlockSize: -1
m_TypetreeBlockSize: -1
m_ProfilerBlockSize: -1
m_ProfilerEditorBlockSize: -1
m_BucketAllocatorGranularity: -1
m_BucketAllocatorBucketsCount: -1
m_BucketAllocatorBlockSize: -1
m_BucketAllocatorBlockCount: -1
m_ProfilerBucketAllocatorGranularity: -1
m_ProfilerBucketAllocatorBucketsCount: -1
m_ProfilerBucketAllocatorBlockSize: -1
m_ProfilerBucketAllocatorBlockCount: -1
m_TempAllocatorSizeMain: -1
m_JobTempAllocatorBlockSize: -1
m_BackgroundJobTempAllocatorBlockSize: -1
m_JobTempAllocatorReducedBlockSize: -1
m_TempAllocatorSizeGIBakingWorker: -1
m_TempAllocatorSizeNavMeshWorker: -1
m_TempAllocatorSizeAudioWorker: -1
m_TempAllocatorSizeCloudWorker: -1
m_TempAllocatorSizeGfx: -1
m_TempAllocatorSizeJobWorker: -1
m_TempAllocatorSizeBackgroundWorker: -1
m_TempAllocatorSizePreloadManager: -1
m_PlatformMemorySettings: {}
Loading