Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
189 changes: 185 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ jobs:
- name: Integration test
# # Note that when upgrading .NET versions, linux-musl may need special handling... see comments below
# if: ${{ (matrix.rid != 'linux-musl-x64') && (matrix.rid != 'linux-musl-arm64') }}
# TODO: Re-enable once we have resolved https://github.com/getsentry/sentry-dotnet/issues/4788
if: ${{ (matrix.rid != 'linux-musl-x64') }}
# The other legs' integration tests run in the integration-test job
if: matrix.rid == 'linux-arm64' || matrix.rid == 'linux-musl-x64' || matrix.rid == 'linux-musl-arm64' || matrix.rid == 'macos'
uses: getsentry/github-workflows/sentry-cli/integration-test@959162c159b866489d3fabe93327f48f9b8cb7ee # 3.4.1
# The MAUI cases run in the integration-test job, against packages built there. On release branches they run
# here too, so the packages craft publishes are the ones tested.
env:
SKIP_MAUI_TESTS: ${{ runner.os == 'macOS' && !startsWith(github.ref_name, 'release/') }}
with:
path: integration-test

Expand All @@ -336,6 +340,96 @@ jobs:
# with:
# path: integration-test

# These run integration tests next to a build leg, against packages built here from only the projects the tests
# use, which the Sentry-CI-IntegrationTest filters list. CI_PUBLISHING_BUILD only adds the other platforms' native
# libraries and sentry-cli binaries, which these tests don't use.
# - macos: the MAUI cases build three Release apps, which takes 8-10 minutes. On release branches the macOS leg
# runs them too, against the packages it publishes.
# - linux-x64, win-x64 and win-arm64: every integration test runs here, in parallel with the leg.
integration-test:
needs: build-sentry-native
name: Integration test (${{ matrix.rid }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- os: xcode-27
rid: macos
slnf: Sentry-CI-IntegrationTest-macOS.slnf
tests: integration-test/cli-maui.Tests.ps1
- os: ubuntu-24.04
rid: linux-x64
slnf: Sentry-CI-IntegrationTest.slnf
tests: integration-test
- os: windows-latest
rid: win-x64
slnf: Sentry-CI-IntegrationTest.slnf
tests: integration-test
- os: windows-11-arm
rid: win-arm64
slnf: Sentry-CI-IntegrationTest.slnf
tests: integration-test

steps:

@jamescrosswell jamescrosswell Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first 40 lines of code here is almost identical to

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Install .NET and NuGet packages on a fast drive
if: runner.os == 'Windows'
uses: ./.github/actions/windows-dotnet-drive
- name: Setup Environment
uses: ./.github/actions/environment
with:
projects: ${{ matrix.samples }}
- name: Download sentry-native (${{ matrix.rid }})
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: src/Sentry/Platforms/Native/sentry-native
key: sentry-native-${{ matrix.rid }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
fail-on-cache-miss: true
enableCrossOsArchive: true
# See build-sentry
- name: Get Cocoa SDK cache key
id: cocoa-key
if: runner.os == 'macOS'
uses: ./.github/actions/cocoa-cache-key
- name: Restore Cocoa SDK
id: cache-cocoa
if: runner.os == 'macOS' && !startsWith(github.ref_name, 'release/')
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cocoa-key.outputs.key }}
- name: Build Native Dependencies
uses: ./.github/actions/buildnative
- name: Restore .NET Dependencies
run: dotnet restore ${{ matrix.samples }} --nologo
- name: Build
run: dotnet build ${{ matrix.samples }} -c Release --no-restore --nologo -v:minimal -bl:build.binlog
- name: Save Cocoa SDK
if: ${{ !cancelled() && steps.cache-cocoa.outputs.cache-primary-key != '' && steps.cache-cocoa.outputs.cache-hit != 'true' && hashFiles('modules/sentry-cocoa/Carthage/.built-from-sha') != '' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cache-cocoa.outputs.cache-primary-key }}

Maybe as a follow up PR that could be refactored so fixes/changes don't have to be copy/pasted (and more importantly, so they don't fall out of sync).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll pull that into a follow-up once the stack is in.

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive

- name: Remove unused applications
uses: ./.github/actions/freediskspace

- name: Setup Environment
uses: ./.github/actions/environment
with:
projects: ${{ matrix.slnf }}

- name: Download sentry-native (${{ matrix.rid }})
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: src/Sentry/Platforms/Native/sentry-native
key: sentry-native-${{ matrix.rid }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Get Cocoa SDK cache key
id: cocoa-key
if: runner.os == 'macOS'
uses: ./.github/actions/cocoa-cache-key

- name: Restore Cocoa SDK
id: cache-cocoa
if: runner.os == 'macOS' && !startsWith(github.ref_name, 'release/')
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cocoa-key.outputs.key }}

- name: Build Native Dependencies
uses: ./.github/actions/buildnative

- name: Build
run: dotnet build ${{ matrix.slnf }} -c Release --nologo -v:minimal

- name: Save Cocoa SDK
if: ${{ !cancelled() && steps.cache-cocoa.outputs.cache-primary-key != '' && steps.cache-cocoa.outputs.cache-hit != 'true' && hashFiles('modules/sentry-cocoa/Carthage/.built-from-sha') != '' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cache-cocoa.outputs.cache-primary-key }}

# Like the build legs, pack the build outputs. Packing Sentry.Maui while building it on macOS fails with NU5026,
# looking for the Windows target's .pri file, which isn't generated on macOS.
- name: Create NuGet Packages
run: dotnet pack ${{ matrix.slnf }} -c Release --no-build --nologo

- name: Integration test
uses: getsentry/github-workflows/sentry-cli/integration-test@959162c159b866489d3fabe93327f48f9b8cb7ee # 3.4.1
with:
path: ${{ matrix.tests }}

ms-build:
needs: build-sentry-native
name: MSBuild
Expand All @@ -358,7 +452,7 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/environment
with:
projects: Sentry-CI-Build-Windows.slnf
projects: Sentry-CI-Build-Windows.slnf samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj

- name: Build Native Dependencies
uses: ./.github/actions/buildnative
Expand All @@ -370,6 +464,11 @@ jobs:
id: msbuild
run: msbuild Sentry-CI-Build-Windows.slnf -restore -t:Build,Pack -p:Configuration=Release -m -nr:false --nologo -v:minimal -p:CopyLocalLockFileAssemblies=true -bl:msbuild.binlog

# The app samples build in their own job, with the .NET CLI, so the MAUI sample's Android and Windows targets
# get an MSBuild build here
- name: Build the MAUI sample
run: msbuild samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj -restore -t:Build -p:Configuration=Release -m -nr:false --nologo -v:minimal -p:CopyLocalLockFileAssemblies=true -bl:msbuild-maui.binlog

- name: Test MSBuild
uses: getsentry/github-workflows/sentry-cli/integration-test@959162c159b866489d3fabe93327f48f9b8cb7ee # 3.4.1
with:
Expand All @@ -380,7 +479,9 @@ jobs:
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ runner.os }}-msbuild-logs
path: msbuild.binlog
path: |
msbuild.binlog
msbuild-maui.binlog
if-no-files-found: ignore

# Unsupported Native AOT runtimes should have SentryNative auto-disabled
Expand Down Expand Up @@ -477,6 +578,86 @@ jobs:
# - name: Publish Test app (iOS)
# run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net9.0-ios18.0 -r ios-arm64

# Nothing consumes the app samples, but their Release builds trim and AOT-compile each app, which made them the
# last minutes of the Build step in the .NET legs. Here they build next to the legs instead of inside them.
build-samples:
needs: build-sentry-native
name: Samples (${{ matrix.rid }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- os: xcode-27
rid: macos
samples: Sentry-CI-Build-Samples-macOS.slnf
# The MAUI sample's Windows target, which the MSBuild job also builds with msbuild.exe
- os: windows-latest
rid: win-x64
samples: samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj
# The Android and MAUI samples' Android targets on a Linux host, as the linux-x64 leg built them
- os: ubuntu-24.04
rid: linux-x64
samples: Sentry-CI-Build-Samples-Linux.slnf

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive

- name: Setup Environment
uses: ./.github/actions/environment
with:
projects: ${{ matrix.samples }}

- name: Download sentry-native (${{ matrix.rid }})
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: src/Sentry/Platforms/Native/sentry-native
key: sentry-native-${{ matrix.rid }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
fail-on-cache-miss: true
enableCrossOsArchive: true

# See build-sentry
- name: Get Cocoa SDK cache key
id: cocoa-key
if: runner.os == 'macOS'
uses: ./.github/actions/cocoa-cache-key

- name: Restore Cocoa SDK
id: cache-cocoa
if: runner.os == 'macOS' && !startsWith(github.ref_name, 'release/')
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cocoa-key.outputs.key }}

- name: Build Native Dependencies
uses: ./.github/actions/buildnative

- name: Restore .NET Dependencies
run: dotnet restore ${{ matrix.samples }} --nologo

- name: Build
run: dotnet build ${{ matrix.samples }} -c Release --no-restore --nologo -v:minimal -bl:build.binlog

- name: Save Cocoa SDK
if: ${{ !cancelled() && steps.cache-cocoa.outputs.cache-primary-key != '' && steps.cache-cocoa.outputs.cache-hit != 'true' && hashFiles('modules/sentry-cocoa/Carthage/.built-from-sha') != '' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: modules/sentry-cocoa/Carthage
key: ${{ steps.cache-cocoa.outputs.cache-primary-key }}

- name: Upload build logs
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: samples-${{ matrix.rid }}-build-logs
path: build.binlog
if-no-files-found: ignore

test-solution-filters:
runs-on: ubuntu-24.04
if: ${{ !startsWith(github.ref_name, 'release/') }}
Expand Down
10 changes: 7 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ Use solution filters instead of the full `Sentry.slnx`:
| Filter | Use when |
|--------|----------|
| `SentryNoMobile.slnf` | General development (no Android/iOS build toolchain needed for quicker builds) |
| `Sentry-CI-Build-macOS.slnf` | All macOS projects |
| `Sentry-CI-Build-Windows.slnf` | All Windows projects |
| `Sentry-CI-Build-Linux.slnf` | All Linux projects |
| `Sentry-CI-Build-macOS.slnf` | All macOS projects except the app samples |
| `Sentry-CI-Build-Windows.slnf` | All Windows projects except the app samples |
| `Sentry-CI-Build-Linux.slnf` | All Linux projects except the app samples |
| `Sentry-CI-Build-Samples-macOS.slnf` | The MAUI, Android, iOS, Mac Catalyst and macOS sample apps |
| `Sentry-CI-Build-Samples-Linux.slnf` | The MAUI and Android sample apps, built on Linux |
| `Sentry-CI-IntegrationTest-macOS.slnf` | The packages the integration tests use, on macOS |
| `Sentry-CI-IntegrationTest.slnf` | The packages the integration tests use, on Linux and Windows |

> Do **not** edit `*.slnf` files directly. They are generated by `scripts/generate-solution-filters.ps1` from `scripts/generate-solution-filters-config.yaml`.

Expand Down
2 changes: 0 additions & 2 deletions Sentry-CI-Build-Linux.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"projects": [
"benchmarks\\Sentry.Benchmarks\\Sentry.Benchmarks.csproj",
"benchmarks\\Sentry.Extensions.Logging.Benchmarks\\Sentry.Extensions.Logging.Benchmarks.csproj",
"samples\\Sentry.Samples.Android\\Sentry.Samples.Android.csproj",
"samples\\Sentry.Samples.AspNetCore.Basic\\Sentry.Samples.AspNetCore.Basic.csproj",
"samples\\Sentry.Samples.AspNetCore.Blazor.Server\\Sentry.Samples.AspNetCore.Blazor.Server.csproj",
"samples\\Sentry.Samples.AspNetCore.Blazor.Wasm\\Sentry.Samples.AspNetCore.Blazor.Wasm.csproj",
Expand All @@ -25,7 +24,6 @@
"samples\\Sentry.Samples.GraphQL.Server\\Sentry.Samples.GraphQL.Server.csproj",
"samples\\Sentry.Samples.Hangfire\\Sentry.Samples.Hangfire.csproj",
"samples\\Sentry.Samples.Log4Net\\Sentry.Samples.Log4Net.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj",
"samples\\Sentry.Samples.ME.AI.AspNetCore\\Sentry.Samples.ME.AI.AspNetCore.csproj",
"samples\\Sentry.Samples.ME.AI.Console\\Sentry.Samples.ME.AI.Console.csproj",
"samples\\Sentry.Samples.ME.Logging\\Sentry.Samples.ME.Logging.csproj",
Expand Down
9 changes: 9 additions & 0 deletions Sentry-CI-Build-Samples-Linux.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"solution": {
"path": "Sentry.slnx",
"projects": [
"samples\\Sentry.Samples.Android\\Sentry.Samples.Android.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj"
]
}
}
12 changes: 12 additions & 0 deletions Sentry-CI-Build-Samples-macOS.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"solution": {
"path": "Sentry.slnx",
"projects": [
"samples\\Sentry.Samples.Android\\Sentry.Samples.Android.csproj",
"samples\\Sentry.Samples.Ios\\Sentry.Samples.Ios.csproj",
"samples\\Sentry.Samples.MacCatalyst\\Sentry.Samples.MacCatalyst.csproj",
"samples\\Sentry.Samples.MacOS\\Sentry.Samples.MacOS.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj"
]
}
}
1 change: 0 additions & 1 deletion Sentry-CI-Build-Windows-arm64.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"samples\\Sentry.Samples.GraphQL.Server\\Sentry.Samples.GraphQL.Server.csproj",
"samples\\Sentry.Samples.Hangfire\\Sentry.Samples.Hangfire.csproj",
"samples\\Sentry.Samples.Log4Net\\Sentry.Samples.Log4Net.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj",
"samples\\Sentry.Samples.ME.AI.AspNetCore\\Sentry.Samples.ME.AI.AspNetCore.csproj",
"samples\\Sentry.Samples.ME.AI.Console\\Sentry.Samples.ME.AI.Console.csproj",
"samples\\Sentry.Samples.ME.Logging\\Sentry.Samples.ME.Logging.csproj",
Expand Down
1 change: 0 additions & 1 deletion Sentry-CI-Build-Windows.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"samples\\Sentry.Samples.GraphQL.Server\\Sentry.Samples.GraphQL.Server.csproj",
"samples\\Sentry.Samples.Hangfire\\Sentry.Samples.Hangfire.csproj",
"samples\\Sentry.Samples.Log4Net\\Sentry.Samples.Log4Net.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj",
"samples\\Sentry.Samples.ME.AI.AspNetCore\\Sentry.Samples.ME.AI.AspNetCore.csproj",
"samples\\Sentry.Samples.ME.AI.Console\\Sentry.Samples.ME.AI.Console.csproj",
"samples\\Sentry.Samples.ME.Logging\\Sentry.Samples.ME.Logging.csproj",
Expand Down
5 changes: 0 additions & 5 deletions Sentry-CI-Build-macOS.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"benchmarks\\Sentry.Extensions.Logging.Benchmarks\\Sentry.Extensions.Logging.Benchmarks.csproj",
"modules\\perfview\\src\\FastSerialization\\FastSerialization.csproj",
"modules\\perfview\\src\\TraceEvent\\TraceEvent.csproj",
"samples\\Sentry.Samples.Android\\Sentry.Samples.Android.csproj",
"samples\\Sentry.Samples.AspNetCore.Basic\\Sentry.Samples.AspNetCore.Basic.csproj",
"samples\\Sentry.Samples.AspNetCore.Blazor.Server\\Sentry.Samples.AspNetCore.Blazor.Server.csproj",
"samples\\Sentry.Samples.AspNetCore.Blazor.Wasm\\Sentry.Samples.AspNetCore.Blazor.Wasm.csproj",
Expand All @@ -26,11 +25,7 @@
"samples\\Sentry.Samples.GraphQL.Client.Http\\Sentry.Samples.GraphQL.Client.Http.csproj",
"samples\\Sentry.Samples.GraphQL.Server\\Sentry.Samples.GraphQL.Server.csproj",
"samples\\Sentry.Samples.Hangfire\\Sentry.Samples.Hangfire.csproj",
"samples\\Sentry.Samples.Ios\\Sentry.Samples.Ios.csproj",
"samples\\Sentry.Samples.Log4Net\\Sentry.Samples.Log4Net.csproj",
"samples\\Sentry.Samples.MacCatalyst\\Sentry.Samples.MacCatalyst.csproj",
"samples\\Sentry.Samples.MacOS\\Sentry.Samples.MacOS.csproj",
"samples\\Sentry.Samples.Maui\\Sentry.Samples.Maui.csproj",
"samples\\Sentry.Samples.ME.AI.AspNetCore\\Sentry.Samples.ME.AI.AspNetCore.csproj",
"samples\\Sentry.Samples.ME.AI.Console\\Sentry.Samples.ME.AI.Console.csproj",
"samples\\Sentry.Samples.ME.Logging\\Sentry.Samples.ME.Logging.csproj",
Expand Down
13 changes: 13 additions & 0 deletions Sentry-CI-IntegrationTest-macOS.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"solution": {
"path": "Sentry.slnx",
"projects": [
"src\\Sentry.Android.AssemblyReader\\Sentry.Android.AssemblyReader.csproj",
"src\\Sentry.Bindings.Android\\Sentry.Bindings.Android.csproj",
"src\\Sentry.Bindings.Cocoa\\Sentry.Bindings.Cocoa.csproj",
"src\\Sentry.Extensions.Logging\\Sentry.Extensions.Logging.csproj",
"src\\Sentry.Maui\\Sentry.Maui.csproj",
"src\\Sentry\\Sentry.csproj"
]
}
}
12 changes: 12 additions & 0 deletions Sentry-CI-IntegrationTest.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"solution": {
"path": "Sentry.slnx",
"projects": [
"src\\Sentry.Android.AssemblyReader\\Sentry.Android.AssemblyReader.csproj",
"src\\Sentry.Bindings.Android\\Sentry.Bindings.Android.csproj",
"src\\Sentry.Extensions.Logging\\Sentry.Extensions.Logging.csproj",
"src\\Sentry.Maui\\Sentry.Maui.csproj",
"src\\Sentry\\Sentry.csproj"
]
}
}
Loading
Loading