@@ -14,44 +14,58 @@ jobs:
14
14
runs-on : ubuntu-latest
15
15
timeout-minutes : 10
16
16
steps :
17
- - uses : actions/checkout@v3
17
+ - uses : actions/checkout@v4
18
18
- uses : Cysharp/Actions/.github/actions/setup-dotnet@main
19
19
- run : dotnet build -c Debug
20
20
- run : dotnet test -c Debug --no-build
21
21
22
22
build-unity :
23
- if : " ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:'))"
24
- # strategy:
25
- # matrix:
26
- # unity: ["2021.3.11f1"]
23
+ if : ${{ ((github.event_name == 'push' && github.repository_owner == 'Cysharp') || startsWith(github.event.pull_request.head.label, 'Cysharp:')) && github.triggering_actor != 'dependabot[bot]' }}
24
+ strategy :
25
+ fail-fast : false
26
+ matrix :
27
+ unity : ["2022.3.39f1", "6000.0.12f1"] # Test with LTS
27
28
runs-on : ubuntu-latest
28
29
timeout-minutes : 15
29
30
steps :
30
- - uses : actions/checkout@v3
31
- # Execute scripts: RuntimeUnitTestToolkit
32
- # /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend mono /BuildTarget StandaloneLinux64
33
- # - name: Build UnitTest(Linux64, mono)
34
- # uses: Cysharp/Actions/.github/actions/unity-builder@main
35
- # env:
36
- # UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
37
- # UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
38
- # UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
39
- # with:
40
- # projectPath: src/MemoryPack.Unity
41
- # unityVersion: ${{ matrix.unity }}
42
- # targetPlatform: StandaloneLinux64
43
- # buildMethod: UnitTestBuilder.BuildUnitTest
44
- # customParameters: /headless /ScriptBackend mono
45
- # Unity 2021.2 and above changed Headless mode. It seems require Dedicated Server currently and investigating alternative api to enable batch mode.
46
- # - name: Execute UnitTest
47
- # run: ./src/MemoryPack.Unity/bin/UnitTest/StandaloneLinux64_Mono2x/test -batchmode
31
+ - name : Load secrets
32
+ id : op-load-secret
33
+ uses : 1password/load-secrets-action@v2
34
+ with :
35
+ export-env : false
36
+ env :
37
+ OP_SERVICE_ACCOUNT_TOKEN : ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
38
+ UNITY_EMAIL : " op://GitHubActionsPublic/UNITY_LICENSE/username"
39
+ UNITY_PASSWORD : " op://GitHubActionsPublic/UNITY_LICENSE/credential"
40
+ UNITY_SERIAL : " op://GitHubActionsPublic/UNITY_LICENSE/serial"
48
41
49
- - uses : Cysharp/Actions/.github/actions/check-metas@main # check meta files
42
+ - uses : actions/checkout@v4
43
+
44
+ # Run SourceGenerater to generate serialization code
45
+ - uses : Cysharp/Actions/.github/actions/setup-dotnet@main
46
+ - run : dotnet build -c Debug # require build before run
47
+ - name : Make sure generated files are exists.
48
+ run : ls -lR "src/MemoryPack/bin/Debug/netstandard2.1"
49
+
50
+ # Execute Unittest
51
+ # /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
52
+ - name : Build UnitTest
53
+ uses : Cysharp/Actions/.github/actions/unity-builder@main
54
+ env :
55
+ UNITY_EMAIL : ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
56
+ UNITY_PASSWORD : ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
57
+ UNITY_SERIAL : ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
50
58
with :
51
- directory : src/MemoryPack.Unity
59
+ projectPath : src/MemoryPack.Unity
60
+ unityVersion : ${{ matrix.unity }}
61
+ targetPlatform : StandaloneLinux64
62
+ buildMethod : UnitTestBuilder.BuildUnitTest
63
+ customParameters : " /headless /ScriptBackend IL2CPP"
64
+ - name : Check UnitTest file is generated
65
+ run : ls -lR ./src/MemoryPack.Unity/bin/UnitTest
66
+ - name : Execute UnitTest
67
+ run : ./src/MemoryPack.Unity/bin/UnitTest/StandaloneLinux64_IL2CPP/test
52
68
53
- # Store artifacts.
54
- - uses : actions/upload-artifact@v3
69
+ - uses : Cysharp/Actions/.github/actions/check-metas@main # check meta files
55
70
with :
56
- name : MemoryPack.${{ matrix.unity }}.unitypackage
57
- path : ./src/MemoryPack.Unity/*.unitypackage
71
+ directory : src/MemoryPack.Unity
0 commit comments