diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0babcb6cc..67e192314 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,6 +227,10 @@ jobs: if: ${{ !startsWith(matrix.unity-version, '2021') }} run: ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 -PackagePath "dependency-conflict-package" + - name: Disable DependencyConflict (WebGL 2021) + if: ${{ startsWith(matrix.unity-version, '2021') }} + run: ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 -Disable + - name: Configure Sentry run: ./test/Scripts.Integration.Test/configure-sentry.ps1 -UnityPath "$env:UNITY_PATH" -Platform "$env:BUILD_PLATFORM" env: @@ -351,7 +355,8 @@ jobs: fail-fast: false matrix: unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} - ios-version: ["17.0", "latest"] + # On PRs only the newest simulator runs; `17.0` is an OS-compat axis (not SDK behavior) and runs on main. + ios-version: ${{ github.event_name == 'pull_request' && fromJSON('["latest"]') || fromJSON('["17.0", "latest"]') }} init-type: ["runtime", "buildtime"] # Check https://support.apple.com/en-us/HT201222 for the latest minor version for a given major one. # https://developer.apple.com/support/app-store/ shows that of all iOS devices @@ -411,10 +416,6 @@ jobs: fail-fast: false matrix: unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} - # The progressive lightmapper requires a GPU, which the Apple silicon CI runners don't have. - # On Unity 2021 this fails the player build outright (instead of warning), so skip macOS 2021.3. - exclude: - - unity-version: "2021.3" uses: ./.github/workflows/test-build-macos.yml with: unity-version: ${{ matrix.unity-version }} @@ -461,10 +462,6 @@ jobs: matrix: unity-version: ${{ fromJSON(needs.create-unity-matrix.outputs.unity-matrix).unity-version }} backend: ["cocoa", "native"] - # See test-build-macos: the progressive lightmapper needs a GPU the Apple silicon - # CI runners lack, which fails the Unity 2021 player build. Skip macOS 2021.3. - exclude: - - unity-version: "2021.3" uses: ./.github/workflows/test-run-desktop.yml with: unity-version: ${{ matrix.unity-version }} diff --git a/.github/workflows/create-unity-matrix.yml b/.github/workflows/create-unity-matrix.yml index 95a4704cb..5ade8e564 100644 --- a/.github/workflows/create-unity-matrix.yml +++ b/.github/workflows/create-unity-matrix.yml @@ -14,7 +14,7 @@ on: env: # Unity versions used in PRs - PR_UNITY_VERSIONS: '["2022.3", "6000.3", "6000.5"]' + PR_UNITY_VERSIONS: '["2021.3", "6000.5"]' # Unity versions used on main branch FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3", "6000.5"]' diff --git a/test/Scripts.Integration.Test/Editor/Builder.cs b/test/Scripts.Integration.Test/Editor/Builder.cs index b1a1665a4..068ee1d07 100644 --- a/test/Scripts.Integration.Test/Editor/Builder.cs +++ b/test/Scripts.Integration.Test/Editor/Builder.cs @@ -127,7 +127,16 @@ public static void BuildWindowsIl2CPPPlayer() public static void BuildMacIl2CPPPlayer() { Debug.Log("Builder: Building macOS IL2CPP Player"); - BuildIl2CPPPlayer(BuildTarget.StandaloneOSX, BuildTargetGroup.Standalone, BuildOptions.StrictMode, +#if UNITY_2022_1_OR_NEWER + var buildOptions = BuildOptions.StrictMode; +#else + // On 2021.3 the Apple silicon CI has no usable lightmapper (CPU unsupported, no OpenCL GPU + // device), so BuildPlayer always logs "Falling back to CPU lightmapper" as an error. + // StrictMode would escalate that unavoidable log to a build failure even though the build + // succeeds. Real failures are still caught via summary.result. + var buildOptions = BuildOptions.None; +#endif + BuildIl2CPPPlayer(BuildTarget.StandaloneOSX, BuildTargetGroup.Standalone, buildOptions, defaultBuildPath: "./Builds/macOS/test.app"); } diff --git a/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs b/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs index 1c0a52a72..d86f91af8 100644 --- a/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs +++ b/test/Scripts.Integration.Test/Scripts/IntegrationTester.cs @@ -38,7 +38,7 @@ private void Awake() // the build red too instead of being swallowed into a log line. private void ExerciseConflictingDependencies() { -#if !(UNITY_WEBGL && !UNITY_2022_1_OR_NEWER) +#if !SENTRY_DISABLE_DEPENDENCY_CONFLICT try { var greeting = DependencyConflictPackage.DependencyConflictPackageClient.SayHiAsync().GetAwaiter().GetResult(); diff --git a/test/Scripts.Integration.Test/add-dependency-conflict.ps1 b/test/Scripts.Integration.Test/add-dependency-conflict.ps1 index d5e6bcd11..3aa31c30b 100644 --- a/test/Scripts.Integration.Test/add-dependency-conflict.ps1 +++ b/test/Scripts.Integration.Test/add-dependency-conflict.ps1 @@ -5,7 +5,11 @@ param( # `dotnet build test/Scripts.Integration.Test/DependencyConflictPackage`. In CI the # DLLs are built in build.yml and downloaded as an artifact, so the caller # points this at the downloaded copy. - [string] $PackagePath + [string] $PackagePath, + + # Skip installing the package and instead define SENTRY_DISABLE_DEPENDENCY_CONFLICT + # so IntegrationTester.cs compiles out its call into the package. + [switch] $Disable ) if (-not $Global:NewProjectPathCache) @@ -15,6 +19,14 @@ if (-not $Global:NewProjectPathCache) . $PSScriptRoot/common.ps1 +if ($Disable) +{ + $cscRspPath = "$(GetNewProjectAssetsPath)/csc.rsp" + Write-Log "Defining SENTRY_DISABLE_DEPENDENCY_CONFLICT via '$cscRspPath'..." + Add-Content -Path $cscRspPath -Value "-define:SENTRY_DISABLE_DEPENDENCY_CONFLICT" + return +} + # The DependencyConflict package ships plain, UNALIASED System.*/Microsoft.* # assemblies at versions that differ from the ones the Sentry SDK ships aliased. # Dropping it into the test project as an embedded package - alongside Sentry - diff --git a/test/Scripts.Integration.Test/integration-test.ps1 b/test/Scripts.Integration.Test/integration-test.ps1 index b0d1a9af0..183d42256 100644 --- a/test/Scripts.Integration.Test/integration-test.ps1 +++ b/test/Scripts.Integration.Test/integration-test.ps1 @@ -46,13 +46,21 @@ If (-not(Test-Path -Path "$(GetNewProjectPath)")) { Write-PhaseSuccess "Sentry added" Write-PhaseHeader "Adding DependencyConflict (alias stress-test)" - dotnet build test/Scripts.Integration.Test/DependencyConflictPackage - if ($LASTEXITCODE -ne 0) + if ($Platform -eq "WebGL" -and $UnityVersion.StartsWith("2021")) { - Write-Error "Failed to build the DependencyConflict package." + ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 -Disable + Write-PhaseSuccess "DependencyConflict disabled (WebGL 2021)" + } + else + { + dotnet build test/Scripts.Integration.Test/DependencyConflictPackage + if ($LASTEXITCODE -ne 0) + { + Write-Error "Failed to build the DependencyConflict package." + } + ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 + Write-PhaseSuccess "DependencyConflict added" } - ./test/Scripts.Integration.Test/add-dependency-conflict.ps1 - Write-PhaseSuccess "DependencyConflict added" Write-PhaseHeader "Configuring Sentry" ./test/Scripts.Integration.Test/configure-sentry.ps1 "$UnityPath" -Platform $Platform