Skip to content

Commit 1a2431c

Browse files
bitsandfoxesbruno-garcialucas-zimerman
authored
chore: Bump Unity on CI (#500)
* unity bump * updated unity version * bumped 2019.4.34f1 * updated samples project to 2019.4.34f1 * 2021.2 now netstandard 2.1 * released artifact from lowest supported unity version * 'fixed' CI * 'fixed' CI * excluding 2021.2 and newer from running tests * CI exclusion test #2 * CI exclusion test #3 * Apply suggestions from code review Co-authored-by: LucasZF <[email protected]> * use ns2.1 only on tests * moved .ns2.1 to target for tests * test reset after reset * fixed *all* the version numbers * bumped sample too * sticking with 2019.4.34 because 35 is broken * sample to 34, not running on 21 for 2021.2. * fixed if * bumped to 2021.2.10 Co-authored-by: Bruno Garcia <[email protected]> Co-authored-by: LucasZF <[email protected]>
1 parent dbc72c6 commit 1a2431c

File tree

4 files changed

+37
-26
lines changed

4 files changed

+37
-26
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ jobs:
2020
env:
2121
DOTNET_CLI_TELEMETRY_OPTOUT: 1
2222
DOTNET_NOLOGO: 1
23+
LOWEST_SUPPORTED_UNITY_VERSION: 2019.4.34f1
2324
strategy:
2425
fail-fast: false
2526
matrix:
2627
os: [macos-latest, windows-latest]
2728
# 2022.1.0a12 removed until S.T.J issues fixed
28-
unity-version: [2019.4.33f1, 2020.3.21f1, 2021.1.26f1]
29+
unity-version: [2019.4.34f1, 2020.3.27f1, 2021.2.10f1]
2930
include:
3031
- os: windows-latest
3132
unity-installation-path: C:/Program Files/Unity/
@@ -37,12 +38,12 @@ jobs:
3738
unity-root: /Applications/Unity/Hub/Editor/
3839
unity-path: Unity.app/Contents/MacOS
3940
unity-config-path: /Library/Application Support/Unity/config/
40-
- unity-version: 2019.4.33f1
41-
unity-version-changeset: c9b2b02eeeef
42-
- unity-version: 2020.3.21f1
43-
unity-version-changeset: a38c86f6690f
44-
- unity-version: 2021.1.26f1
45-
unity-version-changeset: 6f076387c01d
41+
- unity-version: 2019.4.34f1
42+
unity-version-changeset: 6a9faed444f2
43+
- unity-version: 2020.3.27f1
44+
unity-version-changeset: e759542391ea
45+
- unity-version: 2021.2.10f1
46+
unity-version-changeset: ee872746220e
4647
# - unity-version: 2022.1.0a12
4748
# unity-version-changeset: 816252c3efbb
4849

@@ -194,9 +195,9 @@ jobs:
194195
assemblyalias --target-directory "package-dev/Runtime" --internalize --prefix "Sentry." --assemblies-to-alias "Microsoft*;System*"
195196
196197
- name: Run Unity tests (playmode)
197-
# TODO: Run Play mode tests on 2022 once S.T.J loading issue resolved.
198+
# TODO: Run Play mode tests on 2021.2 or newer once S.T.J loading issue resolved.
198199
# System.MissingMethodException : Method not found: System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse(System.ReadOnlyMemory`1<byte>,System.Text.Json.JsonDocumentOptions)
199-
if: ${{ matrix.unity-version != '2022.1.0a12' }}
200+
if: ${{ !(startsWith(matrix.unity-version, '2021.2')) && !(startsWith(matrix.unity-version, '2022')) }}
200201
env:
201202
UNITY_VERSION: ${{ matrix.unity-version }}
202203
run: dotnet msbuild /t:UnityPlayModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Tests
@@ -209,9 +210,9 @@ jobs:
209210
path: artifacts/test/playmode
210211

211212
- name: Run Unity tests (editmode)
212-
# TODO: Run Edit mode tests on 2022 once S.T.J loading issue resolved.
213+
# TODO: Run Play mode tests on 2021.2 or newer once S.T.J loading issue resolved.
213214
# https://forum.unity.com/threads/unity-future-net-development-status.1092205/page-8#post-7602256
214-
if: ${{ matrix.unity-version != '2022.1.0a12' }}
215+
if: ${{ !(startsWith(matrix.unity-version, '2021.2')) && !(startsWith(matrix.unity-version, '2022')) }}
215216
env:
216217
UNITY_VERSION: ${{ matrix.unity-version }}
217218
run: dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Editor.Tests
@@ -290,7 +291,7 @@ jobs:
290291
- name: Upload release artifacts
291292
uses: actions/upload-artifact@v2
292293
# Only on macOS which contain all native plugin needed
293-
if: matrix.os == 'macos-latest'
294+
if: matrix.os == 'macos-latest' && matrix.unity-version == ${{ env.LOWEST_SUPPORTED_UNITY_VERSION }}
294295
with:
295296
name: ${{ github.sha }}
296297
if-no-files-found: error
@@ -337,9 +338,9 @@ jobs:
337338
max-parallel: 5
338339
fail-fast: false
339340
matrix:
340-
api-level: [21, 27, 29]
341-
avd-target: [default]
342-
unity-version: [2019.4.33f1, 2020.3.21f1, 2021.1.26f1]
341+
api-level: [21, 27, 29]
342+
avd-target: [default]
343+
unity-version: [2019.4.34f1, 2020.3.27f1, 2021.2.10f1]
343344
steps:
344345
- name: Checkout
345346
uses: actions/[email protected]
@@ -354,6 +355,8 @@ jobs:
354355
id: smoke-test
355356
continue-on-error: true
356357
timeout-minutes: 10
358+
# API 21 is no longer supported on Unity 2022
359+
if: ${{ (matrix.unity-version == '2021.2.10f1') && matrix.api-level != '21' }}
357360
uses: reactivecircus/android-emulator-runner@2b2ebf2e518e38a17180117fc2b677006db27330
358361
with:
359362
api-level: ${{ matrix.api-level }}
@@ -377,8 +380,8 @@ jobs:
377380
id: smoke-test-retry
378381
continue-on-error: true
379382
timeout-minutes: 10
380-
# We only want to retry the tests if the previous fail happened on the emulator startup.
381-
if: ${{ steps.smoke-test.outputs.smoke-status != 'Completed' }}
383+
# API 21 is no longer supported on Unity 2022 and we only want to retry the tests if the previous fail happened on the emulator startup.
384+
if: ${{ (matrix.unity-version == '2021.2.10f1') && matrix.api-level != '21' && steps.smoke-test.outputs.smoke-status != 'Completed' }}
382385
uses: reactivecircus/android-emulator-runner@2b2ebf2e518e38a17180117fc2b677006db27330
383386
with:
384387
api-level: ${{ matrix.api-level }}
@@ -412,10 +415,10 @@ jobs:
412415
max-parallel: 2
413416
fail-fast: false
414417
matrix:
415-
api-level: [30]
416-
avd-target: [google_apis]
417-
#api-level 30 image is only available with google services.
418-
unity-version: [2019.4.33f1, 2020.3.21f1, 2021.1.26f1]
418+
api-level: [30]
419+
avd-target: [google_apis]
420+
#api-level 30 image is only available with google services.
421+
unity-version: [2019.4.34f1, 2020.3.27f1, 2021.2.10f1]
419422
steps:
420423
- name: Checkout
421424
uses: actions/[email protected]

Directory.Build.props

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
</PropertyGroup>
1717

1818
<Target Name="ResetTargetFrameworks" AfterTargets="FindUnity" BeforeTargets="BeforeResolveReferences">
19+
<!-- Blocked by https://github.com/getsentry/sentry-unity/issues/513 -->
1920
<!-- With 2022 Unity packages are already targeting ns2.1 and Unity itself only has that as an option so we must target ns2.1 here too: -->
20-
<PropertyGroup Condition="$(UnityVersion.StartsWith('2022'))">
21+
<!-- <PropertyGroup Condition="$(UnityVersion.StartsWith('2021.2')) or $(UnityVersion.StartsWith('2022'))">
2122
<TargetFrameworks>netstandard2.1</TargetFrameworks>
22-
</PropertyGroup>
23+
</PropertyGroup> -->
2324
<!-- Lowest version supported at this time is 2019 and up to 2021 ns2.0 is the only option. -->
24-
<PropertyGroup Condition="$(UnityVersion.StartsWith('2019')) or $(UnityVersion.StartsWith('2020')) or $(UnityVersion.StartsWith('2021'))">
25+
<PropertyGroup Condition="$(UnityVersion.StartsWith('2019')) or $(UnityVersion.StartsWith('2020')) or $(UnityVersion.StartsWith('2021.1'))">
2526
<TargetFrameworks>netstandard2.0</TargetFrameworks>
2627
</PropertyGroup>
2728
<!-- Being specific on which Unity version we support allows us to quickly ajust these settings when adding support to new editors.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2019.4.33f1
2-
m_EditorVersionWithRevision: 2019.4.33f1 (c9b2b02eeeef)
1+
m_EditorVersion: 2019.4.34f1
2+
m_EditorVersionWithRevision: 2019.4.34f1 (6a9faed444f2)

test/Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
<PackageEditorTestsPath>../../$(DevPackageFolderName)/Tests/Editor</PackageEditorTestsPath>
77
</PropertyGroup>
88

9+
<Target Name="ResetTestTargetFrameworks" AfterTargets="ResetTargetFrameworks" BeforeTargets="BeforeResolveReferences">
10+
<!-- With 2022 Unity packages are already targeting ns2.1 and Unity itself only has that as an option so we must target ns2.1 here too: -->
11+
<PropertyGroup Condition="$(UnityVersion.StartsWith('2021.2')) or $(UnityVersion.StartsWith('2022'))">
12+
<TargetFrameworks>netstandard2.1</TargetFrameworks>
13+
</PropertyGroup>
14+
</Target>
15+
916
<!-- Add reference once we figure out where the DLL is (find Unity version and install location) -->
1017
<Target Name="ReferenceUnityEditor" BeforeTargets="BeforeResolveReferences">
1118
<ItemGroup>

0 commit comments

Comments
 (0)