Skip to content

Commit bf26b48

Browse files
committed
ci: bump Unity version to LTS, Unity Unit Test with LTS.
1 parent 2425de8 commit bf26b48

1 file changed

Lines changed: 37 additions & 28 deletions

File tree

.github/workflows/build-debug.yml

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,47 @@ jobs:
2020
- run: dotnet test -c Debug --no-build
2121

2222
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+
matrix:
26+
unity: ["2021.3.41f1", "2022.3.39f1", "6000.0.12f1"] # Test with LTS
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 15
2929
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
30+
- name: Load secrets
31+
id: op-load-secret
32+
uses: 1password/load-secrets-action@v2
33+
with:
34+
export-env: false
35+
env:
36+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
37+
UNITY_EMAIL: "op://GitHubActionsPublic/UNITY_LICENSE/username"
38+
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
39+
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
4840

49-
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
41+
- uses: actions/checkout@v4
42+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
43+
- run: dotnet build -c Debug # require build before run
44+
45+
# Execute Unittest
46+
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
47+
- name: Build UnitTest
48+
uses: Cysharp/Actions/.github/actions/unity-builder@main
49+
env:
50+
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
51+
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
52+
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
5053
with:
51-
directory: src/MemoryPack.Unity
54+
projectPath: src/MemoryPack.Unity
55+
unityVersion: ${{ matrix.unity }}
56+
targetPlatform: StandaloneLinux64
57+
buildMethod: UnitTestBuilder.BuildUnitTest
58+
customParameters: "/headless /ScriptBackend IL2CPP"
59+
- name: Check UnitTest file is generated
60+
run: ls -lR ./src/MemoryPack.Unity/bin/UnitTest
61+
- name: Execute UnitTest
62+
run: ./src/MemoryPack.Unity/bin/UnitTest/StandaloneLinux64_IL2CPP/test
5263

53-
# Store artifacts.
54-
- uses: actions/upload-artifact@v3
64+
- uses: Cysharp/Actions/.github/actions/check-metas@main # check meta files
5565
with:
56-
name: MemoryPack.${{ matrix.unity }}.unitypackage
57-
path: ./src/MemoryPack.Unity/*.unitypackage
66+
directory: src/MemoryPack.Unity

0 commit comments

Comments
 (0)