Skip to content

Commit b2c83aa

Browse files
authored
chore: added unity 6.5 to CI (#2727)
1 parent 5b4f08f commit b2c83aa

8 files changed

Lines changed: 100 additions & 32 deletions

File tree

.github/workflows/create-unity-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ on:
1414

1515
env:
1616
# Unity versions used in PRs
17-
PR_UNITY_VERSIONS: '["2022.3", "6000.0", "6000.3"]'
17+
PR_UNITY_VERSIONS: '["2022.3", "6000.3", "6000.5"]'
1818
# Unity versions used on main branch
19-
FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3"]'
19+
FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3", "6000.5"]'
2020

2121
jobs:
2222
create-unity-matrix:

.github/workflows/test-build-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT
3131
3232
- name: Setup Unity
33-
uses: getsentry/setup-unity@1bbd385ae3b0505069aacc56d47f0a16366f10b1
33+
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
3434
with:
3535
unity-version: ${{ steps.env.outputs.unityVersion }}
3636
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}

.github/workflows/test-build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
"unityChangeset=$($u.changeset)" >> $env:GITHUB_OUTPUT
3131
3232
- name: Setup Unity
33-
uses: getsentry/setup-unity@1bbd385ae3b0505069aacc56d47f0a16366f10b1
33+
uses: getsentry/setup-unity@61c0c0944851685b6c1225e940d1b1ab349e3aa3
3434
with:
3535
unity-version: ${{ steps.env.outputs.unityVersion }}
3636
unity-version-changeset: ${{ steps.env.outputs.unityChangeset }}

.github/workflows/test-run-android.yml

Lines changed: 88 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ on:
1111
init-type:
1212
required: true
1313
type: string
14-
# Map the workflow outputs to job outputs
15-
outputs:
16-
status:
17-
description: "Integration test status"
18-
value: ${{ jobs.run.outputs.status }}
1914

2015
defaults:
2116
run:
@@ -24,15 +19,14 @@ defaults:
2419
jobs:
2520
run:
2621
name: ${{ inputs.unity-version }} ${{ inputs.api-level }} ${{ inputs.init-type }}
27-
runs-on: ubuntu-latest
22+
# Unity 6000.x builds ARM64 so we run Redroid (containerized arm64 Android) on an
23+
# arm64 Linux runner.
24+
runs-on: ${{ fromJSON(inputs.unity-version) >= 6000 && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
2825
env:
2926
ARTIFACTS_PATH: samples/IntegrationTest/test-artifacts/
3027
HOMEBREW_NO_INSTALL_CLEANUP: 1
3128
SENTRY_DSN: ${{ secrets.SENTRY_TEST_DSN }}
3229
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
33-
# Map the job outputs to step outputs
34-
outputs:
35-
status: ${{ steps.integration-test.outputs.status }}
3630

3731
steps:
3832
- name: Checkout
@@ -48,28 +42,45 @@ jobs:
4842
name: testapp-android-compiled-${{ inputs.unity-version }}-${{ inputs.init-type }}
4943
path: samples/IntegrationTest/Build
5044

45+
- name: Determine device
46+
id: device
47+
run: |
48+
if ([double]"${{ inputs.unity-version }}" -ge 6000) {
49+
$device = "redroid"; $arch = "arm64-v8a"
50+
} else {
51+
$device = "emulator"; $arch = "x86_64"
52+
}
53+
"device=$device" >> $env:GITHUB_OUTPUT
54+
"arch=$arch" >> $env:GITHUB_OUTPUT
55+
Write-Host "Using device: $device ($arch)"
56+
57+
# --- x86_64 path: hardware-accelerated emulator on the x86 Linux runner ---
58+
59+
- name: Add Android build-tools to PATH
60+
if: ${{ steps.device.outputs.device == 'emulator' }}
61+
run: |
62+
$buildToolsDir = (Get-ChildItem "$env:ANDROID_HOME/build-tools" -Directory | Sort-Object { [version]$_.Name } | Select-Object -Last 1).FullName
63+
Write-Host "Found build-tools at: $buildToolsDir"
64+
$buildToolsDir >> $env:GITHUB_PATH
65+
5166
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
5267
- name: Enable KVM group perms
68+
if: ${{ steps.device.outputs.device == 'emulator' }}
5369
run: |
5470
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
5571
sudo udevadm control --reload-rules
5672
sudo udevadm trigger --name-match=kvm
5773
5874
# Make sure that the required directories and .cfg do exists. Workaround to keep ADV happy on `ubuntu-latest`.
5975
- name: Setup Android directories
76+
if: ${{ steps.device.outputs.device == 'emulator' }}
6077
run: |
6178
mkdir -p $HOME/.android
6279
mkdir -p $HOME/.android/avd
6380
touch $HOME/.android/repositories.cfg
6481
65-
- name: Add Android build-tools to PATH
66-
run: |
67-
BUILD_TOOLS_DIR=$(ls -d $ANDROID_HOME/build-tools/*/ | sort -V | tail -1)
68-
echo "Found build-tools at: $BUILD_TOOLS_DIR"
69-
echo "$BUILD_TOOLS_DIR" >> $GITHUB_PATH
70-
shell: bash
71-
72-
- name: Run Android Integration Tests
82+
- name: Run Android Integration Tests (emulator)
83+
if: ${{ steps.device.outputs.device == 'emulator' }}
7384
uses: reactivecircus/android-emulator-runner@0a638108440efd5c7f980e6ba145dbcdd8f32009 # v2.37.0
7485
id: integration-test
7586
timeout-minutes: 30
@@ -90,13 +101,72 @@ jobs:
90101
-camera-front none
91102
-timezone US/Pacific
92103
-no-metrics
93-
arch: x86_64
104+
arch: ${{ steps.device.outputs.arch }}
94105
script: |
95106
adb wait-for-device
96107
adb shell input keyevent 82
97108
adb devices -l
98109
pwsh -Command '$env:SENTRY_TEST_PLATFORM = "Android"; $env:SENTRY_TEST_APP = "samples/IntegrationTest/Build/test.apk"; Invoke-Pester -Path test/IntegrationTest/Integration.Tests.ps1 -CI'
99110
111+
# --- arm64 path: Redroid container on the arm64 runner (no hypervisor needed) ---
112+
113+
- name: Start Redroid container
114+
if: ${{ steps.device.outputs.device == 'redroid' }}
115+
run: |
116+
$ErrorActionPreference = "Stop"
117+
$PSNativeCommandUseErrorActionPreference = $true
118+
$kernel = uname -r
119+
sudo apt-get update
120+
sudo apt-get install -y adb aapt "linux-modules-extra-$kernel"
121+
sudo modprobe binder_linux devices="binder,hwbinder,vndbinder"
122+
$PSNativeCommandUseErrorActionPreference = $false
123+
sudo modprobe ashmem_linux # built into the kernel on newer releases; ignore if absent
124+
$PSNativeCommandUseErrorActionPreference = $true
125+
$hasBinder = (Test-Path /dev/binderfs) -or
126+
(Select-String -Path /proc/filesystems -Pattern '\bbinder\b' -Quiet) -or
127+
(Test-Path /dev/binder)
128+
if (-not $hasBinder) {
129+
Write-Error "binder is unavailable on this kernel ($kernel); Redroid cannot run."
130+
exit 1
131+
}
132+
docker run -d --rm --privileged `
133+
--name redroid `
134+
-p 5555:5555 `
135+
redroid/redroid:13.0.0_64only-latest `
136+
androidboot.redroid_gpu_mode=guest
137+
138+
- name: Run Android Integration Tests (redroid)
139+
if: ${{ steps.device.outputs.device == 'redroid' }}
140+
id: integration-test-redroid
141+
timeout-minutes: 30
142+
env:
143+
# adb auto-detects Redroid both on the emulator console port (emulator-5554) and via our
144+
# `adb connect` (localhost:5555). Pin a single serial so bare `adb` commands in the test
145+
# (e.g. the launcher-activity dumpsys) don't fail/misfire with "more than one device".
146+
ANDROID_SERIAL: localhost:5555
147+
run: |
148+
$ErrorActionPreference = "Stop"
149+
# adbd inside Redroid takes a while to come up. `adb connect` reports success even when the
150+
# port isn't serving yet and the transport stays 'offline', so poll connect + boot state
151+
# together instead of relying on `adb wait-for-device`.
152+
for ($i = 1; $i -le 60; $i++) {
153+
adb connect localhost:5555 *> $null
154+
$booted = (adb -s localhost:5555 shell getprop sys.boot_completed 2>$null | Out-String).Trim()
155+
if ($booted -eq "1") { Write-Host "Redroid booted after $($i * 5)s"; break }
156+
if ($i -eq 60) {
157+
Write-Host "Redroid did not boot in time"
158+
adb devices -l
159+
docker logs redroid 2>&1 | Select-Object -Last 80
160+
adb -s localhost:5555 logcat -d 2>&1 | Select-Object -Last 100
161+
exit 1
162+
}
163+
Start-Sleep -Seconds 5
164+
}
165+
adb devices -l
166+
$env:SENTRY_TEST_PLATFORM = "Android"
167+
$env:SENTRY_TEST_APP = "samples/IntegrationTest/Build/test.apk"
168+
Invoke-Pester -Path test/IntegrationTest/Integration.Tests.ps1 -CI
169+
100170
- name: Upload test results on failure
101171
if: ${{ failure() }}
102172
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

scripts/unity-versions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
"6000.3": {
1515
"version": "6000.3.18f1",
1616
"changeset": "5ebeb53e4c07"
17+
},
18+
"6000.5": {
19+
"version": "6000.5.0f1",
20+
"changeset": "88b47c5e7076"
1721
}
1822
}

test/IntegrationTest/CommonTestCases.ps1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ $CommonTestCases = @(
8686
$SentryEvent.breadcrumbs.values | Should -Not -BeNullOrEmpty
8787
$SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Integration test started" } | Should -Not -BeNullOrEmpty
8888
$SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Context configuration finished" } | Should -Not -BeNullOrEmpty
89-
90-
$dataCrumb = $SentryEvent.breadcrumbs.values | Where-Object { $_.message -eq "Context configuration finished" }
91-
$dataCrumb | Should -Not -BeNullOrEmpty
92-
$dataCrumb.data.integration_test_key | Should -Be "integration_test_value"
9389
}
9490
}
9591
@{ Name = "Contains SDK information"; TestBlock = {

test/Scripts.Integration.Test/Editor/Builder.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ public static void BuildIl2CPPPlayer(BuildTarget target, BuildTargetGroup group,
8080
PlayerSettings.Android.minifyDebug = PlayerSettings.Android.minifyRelease = true;
8181

8282
#if UNITY_6000_0_OR_NEWER
83-
Debug.Log("Builder: Setting target architectures");
84-
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.All;
83+
// X86_64 has been deprecated and was removed with 6.5
84+
Debug.Log("Builder: Setting target architecture to ARM64");
85+
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
8586
#endif
8687
}
8788

test/Scripts.Integration.Test/Scripts/IntegrationTester.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ private void AddIntegrationTestContext(string testType)
124124
};
125125
});
126126

127-
SentrySdk.AddBreadcrumb("Context configuration finished", data: new Dictionary<string, string>
128-
{
129-
{ "integration_test_key", "integration_test_value" }
130-
});
127+
SentrySdk.AddBreadcrumb("Context configuration finished");
131128
}
132129

133130
private IEnumerator MessageCapture()

0 commit comments

Comments
 (0)