Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test AOT on all platforms
  • Loading branch information
jpnurmi committed Jun 20, 2025
commit 1ec3d8cb012b284bb2d27f79a1ceb7c9d1940a9c
37 changes: 0 additions & 37 deletions .github/actions/testcontainer/action.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ jobs:
with:
path: integration-test

- name: Container test
if: ${{ runner.os == 'Linux' && !matrix.container }}
uses: ./.github/actions/testcontainer
- name: AOT test
shell: pwsh
run: scripts/aot-test.ps1

trim-analysis:
needs: build-sentry-native
Expand Down
42 changes: 42 additions & 0 deletions scripts/aot-test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$package = Get-ChildItem -Path "$PSScriptRoot/../src/Sentry/bin/Release/Sentry.*.nupkg" -File | Select-Object -First 1
if (-not $package) {
Write-Error "No NuGet package found in src/Sentry/bin/Release."
exit 1
}

$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName())
Write-Host "Testing $package in $tempDir"
dotnet --info

# Setup local NuGet source
$localPackages = Join-Path $tempDir "packages"
New-Item -ItemType Directory -Path $localPackages -Force | Out-Null
Copy-Item $package $localPackages
$localConfig = Join-Path $tempDir "nuget.conf"
Copy-Item $PSScriptRoot/../integration-test/nuget.config $localConfig
dotnet nuget list source --configfile $localConfig

# Setup test project
Set-Location $tempDir
dotnet new console --aot --name hello-sentry --output .
dotnet add package Sentry --prerelease --source $localPackages
@"
SentrySdk.Init(options =>
{
options.Dsn = "https://[email protected]/42";
options.Debug = true;
});
Console.WriteLine("Hello, Sentry!");
"@ | Set-Content Program.cs

# Test AOT
dotnet publish
$tfm = (Get-ChildItem -Path "bin/Release" -Directory | Select-Object -First 1).Name
$rid = (Get-ChildItem -Path "bin/Release/$tfm" -Directory | Select-Object -First 1).Name
& "bin/Release/$tfm/$rid/publish/hello-sentry"

# Test Container
if ($IsLinux) {
dotnet publish -p:EnableSdkContainerSupport=true -t:PublishContainer
docker run hello-sentry
}
Loading