Skip to content

Commit aec9f39

Browse files
committed
ci: enable Unity Test on Release flow
1 parent ffb915e commit aec9f39

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/build-debug.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
4141

4242
- uses: actions/checkout@v4
43+
44+
# Run SourceGenerater to generate serialization code
4345
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
4446
- run: dotnet build -c Debug # require build before run
4547
- name: Make sure generated files are exists.

.github/workflows/build-release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,43 @@ jobs:
4646
runs-on: ubuntu-latest
4747
timeout-minutes: 15
4848
steps:
49+
- name: Load secrets
50+
id: op-load-secret
51+
uses: 1password/load-secrets-action@v2
52+
with:
53+
export-env: false
54+
env:
55+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN_PUBLIC }}
56+
UNITY_EMAIL: "op://GitHubActionsPublic/UNITY_LICENSE/username"
57+
UNITY_PASSWORD: "op://GitHubActionsPublic/UNITY_LICENSE/credential"
58+
UNITY_SERIAL: "op://GitHubActionsPublic/UNITY_LICENSE/serial"
59+
4960
- run: echo ${{ needs.update-packagejson.outputs.sha }}
5061
- uses: actions/checkout@v4
5162
with:
5263
ref: ${{ needs.update-packagejson.outputs.sha }}
64+
65+
# Run SourceGenerater to generate serialization code
66+
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
67+
- run: dotnet build -c Debug # require build before run
68+
- name: Make sure generated files are exists.
69+
run: ls -lR "src/MemoryPack/bin/Debug/netstandard2.1"
70+
71+
# Execute Unittest
72+
# /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
73+
- name: Build UnitTest
74+
uses: Cysharp/Actions/.github/actions/unity-builder@main
75+
env:
76+
UNITY_EMAIL: ${{ steps.op-load-secret.outputs.UNITY_EMAIL }}
77+
UNITY_PASSWORD: ${{ steps.op-load-secret.outputs.UNITY_PASSWORD }}
78+
UNITY_SERIAL: ${{ steps.op-load-secret.outputs.UNITY_SERIAL }}
79+
with:
80+
projectPath: src/MemoryPack.Unity
81+
unityVersion: ${{ matrix.unity }}
82+
targetPlatform: StandaloneLinux64
83+
buildMethod: UnitTestBuilder.BuildUnitTest
84+
customParameters: "/headless /ScriptBackend IL2CPP"
85+
5386
# check meta files
5487
- uses: Cysharp/Actions/.github/actions/check-metas@main
5588
with:

0 commit comments

Comments
 (0)