-
-
Notifications
You must be signed in to change notification settings - Fork 12
142 lines (128 loc) · 4.61 KB
/
unity-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Unity Tests
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
unity-tests:
name: ${{ matrix.unity.major }}-${{ matrix.configuration.name }}-${{ matrix.objectPooling.name }}-${{ matrix.testMode.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
testMode:
- {
name: Editor,
value: PlayMode,
}
- {
name: Standalone,
value: Standalone,
}
# Not testing WebGL as unity-test-runner does not support it.
#- {
# name: WebGL,
# value: WebGL,
# buildTargetId: 13
# }
configuration:
- {
name: Release,
symbol: PROTO_PROMISE_DEBUG_DISABLE
}
- {
name: Debug,
symbol: PROTO_PROMISE_DEBUG_ENABLE
}
objectPooling:
- {
name: Pool_Enabled,
symbol: PROTO_PROMISE_POOL_ENABLE
}
- {
name: Pool_Disabled,
symbol: PROTO_PROMISE_POOL_DISABLE
}
# Editor uses 2018 to test netstandard2.0 in Mono.
# Standalone uses 2019 and 2023 to test IL2CPP with netstandard2.0 and netstandard2.1.
unity:
- {
major: 2018,
version: 2018.4.36f1,
}
- {
major: 2019,
version: 2019.4.40f1,
}
- {
major: 2023,
version: 2023.1.0f1,
}
exclude:
# DEBUG mode forces pooling disabled.
- {
configuration: { name: Debug },
objectPooling: { name: Pool_Enabled }
}
# Editor tests only run in 2018.4 to keep CI times down.
- {
testMode: { name: Editor },
unity: { major: 2019 }
}
- {
testMode: { name: Editor },
unity: { major: 2023 }
}
# Standalone with IL2CPP can only be built with 2019.4+ (unity-builder docker images constraint).
- {
testMode: { name: Standalone },
unity: { major: 2018 }
}
include:
# id 1 for old Unity versions, Standalone for new Unity versions.
# This is hard-coded for Standalone, since we can't run WebGL tests in CI.
- unity: { major: 2018 }
buildTargetId: 1
- unity: { major: 2019 }
buildTargetId: 1
- unity: { major: 2023 }
buildTargetId: standalone
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy Project Settings
run: cp -a .github/unityci/Unity_${{ matrix.unity.major }}_Settings/. ProtoPromise_Unity/
- name: Rewrite ProjectSettings
run: |
DefineOriginal=" scriptingDefineSymbols: {}"
DefineReplace=" scriptingDefineSymbols: \\n ${{ matrix.buildTargetId }}: ${{ matrix.configuration.symbol }};${{ matrix.objectPooling.symbol }}"
sed -i "{s/$DefineOriginal/$DefineReplace/g}" ProtoPromise_Unity/ProjectSettings/ProjectSettings.asset
# Linux IL2CPP builds consume extra disk space, so we free up some disk space to prevent the build from failing.
- name: Delete Extra ProjectSettings
run: rm -r -f .github/unityci
if: matrix.testMode.name == 'Standalone'
- uses: jlumbroso/[email protected]
if: matrix.testMode.name == 'Standalone'
- name: Run tests
id: tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE_2018_4_36F1_UBUNTU }}
with:
projectPath: ProtoPromise_Unity
testMode: ${{ matrix.testMode.value }}
unityVersion: ${{ matrix.unity.version }}
timeout-minutes: 180
- uses: dorny/test-reporter@main
if: always()
with:
name: unity-test-results-${{ matrix.unity.major }}-${{ matrix.testMode.name }}-${{ matrix.configuration.name }}-${{ matrix.objectPooling.name }}
path: 'artifacts/*.xml'
reporter: dotnet-nunit
- uses: actions/upload-artifact@v4
if: always()
with:
name: unity-test-results-${{ matrix.unity.major }}-${{ matrix.testMode.name }}-${{ matrix.configuration.name }}-${{ matrix.objectPooling.name }}
path: artifacts