@@ -2,82 +2,59 @@ name: Test runner unity-appsflyer-plugin
22
33on :
44 workflow_call :
5-
5+
66jobs :
7- testAndroid :
8- name : Test in ${{ matrix.targetPlatform }}
7+ run-unity-tests :
8+ name : Run ${{ matrix.testMode }} tests for ${{ matrix.targetPlatform }}
99 runs-on : ubuntu-latest
10+
1011 strategy :
1112 fail-fast : false
1213 matrix :
13- projectPath :
14- - .
15- testMode :
16- - playmode
17- targetPlatform :
18- - iOS
14+ testMode : [playmode]
15+ targetPlatform : [iOS, Android, Shared]
16+
1917 steps :
2018 - uses : actions/checkout@v2
2119 with :
2220 lfs : true
23- - name : free up space
21+
22+ - name : Free up disk space
2423 run : |
2524 rm -rf /usr/share/dotnet/
2625 rm -rf "/usr/local/share/boost"
2726 rm -rf "$AGENT_TOOLSDIRECTORY"
2827 rm -rf /opt/ghc
29- - uses : game-ci/unity-builder@v2
30- env :
31- UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
32- UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
33- UNITY_SERIAL : ${{ secrets.UNITY_SERIAL }}
34- with :
35- targetPlatform : iOS
36- - uses : actions/upload-artifact@v4
37- with :
38- name : Build
39- path : build
28+
4029 - uses : actions/cache@v4
4130 with :
42- path : ${{ matrix.projectPath }}/ Library
43- key : Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ hashFiles(matrix.projectPath ) }}
31+ path : Library
32+ key : Library-${{ matrix.targetPlatform }}-${{ matrix.testMode }}-${{ hashFiles('**/*.cs' ) }}
4433 restore-keys : |
45- Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-
46- Library-${{ matrix.projectPath }}-
34+ Library-${{ matrix.targetPlatform }}-${{ matrix.testMode }}-
35+ Library-${{ matrix.targetPlatform }}-
4736 Library-
37+
4838 - uses : game-ci/unity-test-runner@v2
4939 id : tests
5040 env :
5141 UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
5242 UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
5343 UNITY_SERIAL : ${{ secrets.UNITY_SERIAL }}
5444 with :
55- projectPath : ${{ matrix.projectPath }}
45+ projectPath : .
5646 testMode : ${{ matrix.testMode }}
57- artifactsPath : ${{ matrix.testMode }}-artifacts
47+ artifactsPath : ${{ matrix.targetPlatform }}-artifacts
5848 githubToken : ${{ secrets.GITHUB_TOKEN }}
59- checkName : ${{ matrix.testMode }} Test Results
60- customParameters : -buildTarget iOS -nographics
61- - name : " Freeing up disk space on CI system"
62- run : |
63- # Before
64- echo "Disk space before:"
65- df -h
66-
67- echo "Removing large directories"
68- # https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
69- rm -rf /usr/share/dotnet/
70-
71- # https://github.com/actions/virtual-environments/issues/709#issuecomment-612569242
72- rm -rf "/usr/local/share/boost"
73- rm -rf "$AGENT_TOOLSDIRECTORY"
74- rm -rf /opt/ghc
49+ checkName : ${{ matrix.targetPlatform }} Test Results
50+ customParameters : >
51+ -nographics
52+ -buildTarget ${{ matrix.targetPlatform == 'Shared' && 'StandaloneLinux64' || matrix.targetPlatform }}
53+ -defineSymbols ${{ matrix.targetPlatform == 'Shared' && '' || format('UNITY_{0}', matrix.targetPlatform) }}
7554
76- # After
77- echo "Disk space after:"
78- df -h
79- - uses : actions/upload-artifact@v4
55+ - name : Upload test results
8056 if : always()
57+ uses : actions/upload-artifact@v4
8158 with :
82- name : Test results for ${{ matrix.testMode }}
59+ name : Test results - ${{ matrix.targetPlatform }}
8360 path : ${{ steps.tests.outputs.artifactsPath }}
0 commit comments