Skip to content

Commit 1827be2

Browse files
authored
Merge pull request #603 from Cysharp/feature/test
ci: Change Unity UnitTest from Mono to IL2CPP and enabled on CI
2 parents cdf88c6 + 8560561 commit 1827be2

29 files changed

+874
-2004
lines changed

.github/workflows/build-debug.yml

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 10
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
1818
- run: dotnet build -c Debug
1919
- run: dotnet test -c Debug
2020

2121
build-unity:
2222
if: ${{ (github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:') }}
2323
strategy:
24+
fail-fast: false
2425
matrix:
25-
unity: ["2019.3.9f1", "2019.4.13f1", "2020.1.12f1"]
26+
unity: ["2021.3.41f1", "2022.3.39f1", "6000.0.12f1"] # Test with LTS
2627
runs-on: ubuntu-latest
27-
timeout-minutes: 15
28+
timeout-minutes: 20
2829
steps:
2930
- name: Load secrets
3031
id: op-load-secret
@@ -37,23 +38,7 @@ jobs:
3738
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
3839
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
3940

40-
- uses: actions/checkout@v3
41-
# Execute scripts: RuntimeUnitTestToolkit
42-
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend mono /BuildTarget StandaloneLinux64
43-
- name: Build UnitTest(Linux64, mono)
44-
uses: Cysharp/Actions/.github/actions/unity-builder@main
45-
env:
46-
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
47-
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
48-
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
49-
with:
50-
projectPath: src/UniTask
51-
unityVersion: ${{ matrix.unity }}
52-
targetPlatform: StandaloneLinux64
53-
buildMethod: UnitTestBuilder.BuildUnitTest
54-
customParameters: /headless /ScriptBackend mono
55-
- name: Execute UnitTest
56-
run: ./src/UniTask/bin/UnitTest/StandaloneLinux64_Mono2x/test
41+
- uses: actions/checkout@v4
5742

5843
# Execute scripts: Export Package
5944
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
@@ -79,3 +64,45 @@ jobs:
7964
name: UniTask.unitypackage-${{ matrix.unity }}.zip
8065
path: ./src/UniTask/*.unitypackage
8166
retention-days: 1
67+
68+
test-unity:
69+
needs: [build-unity]
70+
if: ${{ (github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:') }}
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
unity: ["2021.3.41f1", "2022.3.39f1", "6000.0.12f1"] # Test with LTS
75+
runs-on: ubuntu-latest
76+
timeout-minutes: 20
77+
steps:
78+
- name: Load secrets
79+
id: op-load-secret
80+
uses: 1password/load-secrets-action@v2
81+
with:
82+
export-env: false
83+
env:
84+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
85+
UNITY_EMAIL: "op://GitHubActionsPublic/UNITY_LICENSE/username"
86+
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
87+
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
88+
89+
- uses: actions/checkout@v4
90+
91+
# Execute UnitTest
92+
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
93+
- name: Build UnitTest
94+
uses: Cysharp/Actions/.github/actions/unity-builder@main
95+
env:
96+
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
97+
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
98+
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
99+
with:
100+
projectPath: src/UniTask
101+
unityVersion: ${{ matrix.unity }}
102+
targetPlatform: StandaloneLinux64
103+
buildMethod: UnitTestBuilder.BuildUnitTest
104+
customParameters: "/headless /ScriptBackend IL2CPP"
105+
- name: Check UnitTest file is generated
106+
run: ls -lR ./src/UniTask/bin/UnitTest
107+
- name: Execute UnitTest
108+
run: ./src/UniTask/bin/UnitTest/StandaloneLinux64_IL2CPP/test

.github/workflows/build-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 10
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1616
with:
1717
repository: Cysharp/DocfxTemplate
1818
path: docs/_DocfxTemplate

.github/workflows/build-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
timeout-minutes: 10
2727
steps:
2828
- run: echo ${{ needs.update-packagejson.outputs.sha }}
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
with:
3131
ref: ${{ needs.update-packagejson.outputs.sha }}
3232
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
@@ -45,7 +45,7 @@ jobs:
4545
needs: [update-packagejson]
4646
strategy:
4747
matrix:
48-
unity: ["2019.3.9f1"]
48+
unity: ["2021.3.41f1"]
4949
runs-on: ubuntu-latest
5050
timeout-minutes: 15
5151
steps:
@@ -61,7 +61,7 @@ jobs:
6161
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
6262

6363
- run: echo ${{ needs.update-packagejson.outputs.sha }}
64-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6565
with:
6666
ref: ${{ needs.update-packagejson.outputs.sha }}
6767
# Execute scripts: Export Package

.gitignore

Lines changed: 5 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ _ReSharper*
8080
*.ncrunch*
8181
.*crunch*.local.xml
8282

83-
# Installshield output folder
83+
# Installshield output folder
8484
[Ee]xpress
8585

8686
# DocProject is a documentation generator add-in
@@ -148,116 +148,8 @@ UniRx\.Async\.unitypackage
148148

149149
UniRx.Async.Tests.Editor.csproj
150150

151-
src/UniTask/UniTask.csproj
151+
src/UniTask/*.csproj
152+
.vsconfig
152153

153-
src/UniTask/UniTask.Editor.csproj
154-
155-
src/UniTask/UniTask.Tests.csproj
156-
157-
src/UniTask/UniTask.Tests.Editor.csproj
158-
159-
src/UniTask/UniTask.*.unitypackage
160-
161-
src/UniTask/UniTask.Linq.csproj
162-
163-
src/UniTask/DOTween.Modules.csproj
164-
165-
src/UniTask/Unity.Addressables.csproj
166-
167-
src/UniTask/Unity.Addressables.Editor.csproj
168-
169-
src/UniTask/Unity.Analytics.DataPrivacy.csproj
170-
171-
src/UniTask/Unity.Recorder.csproj
172-
173-
src/UniTask/Unity.Recorder.Editor.csproj
174-
175-
src/UniTask/Unity.ResourceManager.csproj
176-
177-
src/UniTask/Unity.Rider.Editor.csproj
178-
179-
src/UniTask/Unity.ScriptableBuildPipeline.csproj
180-
181-
src/UniTask/Unity.ScriptableBuildPipeline.Editor.csproj
182-
183-
src/UniTask/Unity.TextMeshPro.csproj
184-
185-
src/UniTask/Unity.TextMeshPro.Editor.csproj
186-
187-
src/UniTask/Unity.Timeline.csproj
188-
189-
src/UniTask/Unity.Timeline.Editor.csproj
190-
191-
src/UniTask/Unity.VisualStudio.Editor.csproj
192-
193-
src/UniTask/Unity.VSCode.Editor.csproj
194-
195-
src/UniTask/UnityEditor.CacheServer.csproj
196-
197-
src/UniTask/UnityEditor.TestRunner.csproj
198-
199-
src/UniTask/UnityEditor.UI.csproj
200-
201-
src/UniTask/UnityEngine.Advertisements.csproj
202-
203-
src/UniTask/UnityEngine.Monetization.csproj
204-
205-
src/UniTask/UnityEngine.TestRunner.csproj
206-
207-
src/UniTask/UnityEngine.UI.csproj
208-
209-
src/UniTask/TempAsm.csproj
210-
211-
src/UniTask/UniTask.Addressables.csproj
212-
213-
src/UniTask/UniTask.DOTween.csproj
214-
215-
src/UniTask/UniTask.TextMeshPro.csproj
216-
217-
src/UniTask/RuntimeUnitTestToolkit.Player.csproj
218-
219-
src/UniTask/TempAsm.Player.csproj
220-
221-
src/UniTask/UniTask.Addressables.Player.csproj
222-
223-
src/UniTask/UniTask.DOTween.Player.csproj
224-
225-
src/UniTask/UniTask.Linq.Player.csproj
226-
227-
src/UniTask/UniTask.Player.csproj
228-
229-
src/UniTask/UniTask.Tests.Player.csproj
230-
231-
src/UniTask/UniTask.TextMeshPro.Player.csproj
232-
233-
src/UniTask/Unity.Addressables.Player.csproj
234-
235-
src/UniTask/Unity.Analytics.DataPrivacy.Player.csproj
236-
237-
src/UniTask/Unity.ResourceManager.Player.csproj
238-
239-
src/UniTask/Unity.ScriptableBuildPipeline.Player.csproj
240-
241-
src/UniTask/Unity.TextMeshPro.Player.csproj
242-
243-
src/UniTask/Unity.Timeline.Player.csproj
244-
245-
src/UniTask/UnityEngine.Advertisements.Player.csproj
246-
247-
src/UniTask/UnityEngine.Monetization.Player.csproj
248-
249-
src/UniTask/UnityEngine.TestRunner.Player.csproj
250-
251-
src/UniTask/UnityEngine.UI.Player.csproj
252-
253-
src/UniTask/DOTween.Modules.Player.csproj
254-
255-
src/UniTask/Assembly-CSharp.Player.csproj
256-
257-
src/UniTask/Unity.EditorCoroutines.Editor.csproj
258-
259-
src/UniTask/.vsconfig
260-
261-
src/UniTask/Logs/ApiUpdaterCheck.txt
262-
263-
src/UniTask/Assembly-CSharp-firstpass.csproj
154+
# Unity
155+
!src/UniTask/Packages/

src/UniTask/Assets/RuntimeUnitTestToolkit.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/UniTask/Assets/RuntimeUnitTestToolkit/Editor.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)