Skip to content
Closed
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
84 changes: 84 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ jobs:
id: msbuild
run: msbuild Sentry-CI-Build-Windows.slnf -t:Restore,Build,Pack -p:Configuration=Release --nologo -v:minimal -flp:logfile=msbuild.log -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 -t:Restore,Build -p:Configuration=Release --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 @@ -381,6 +386,7 @@ jobs:
path: |
msbuild.log
msbuild.binlog
msbuild-maui.binlog
if-no-files-found: ignore

# Unsupported Native AOT runtimes should have SentryNative auto-disabled
Expand Down Expand Up @@ -475,6 +481,84 @@ 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 only build of the MAUI sample's Windows target
- 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

- 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
8 changes: 5 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ 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 |

> 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
23 changes: 23 additions & 0 deletions scripts/generate-solution-filters-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ groupConfigs:
- "**/*Ios*.csproj"
- "**/*MacCatalyst*.csproj"
- "**/*Maui*.csproj"
# The build workflow builds these in its own job, off the critical path
appSamples:
- "**/Sentry.Samples.Android.csproj"
- "**/Sentry.Samples.Ios.csproj"
- "**/Sentry.Samples.MacCatalyst.csproj"
- "**/Sentry.Samples.MacOS.csproj"
- "**/Sentry.Samples.Maui.csproj"

filterConfigs:

Expand All @@ -48,6 +55,7 @@ filterConfigs:
- "allProjects"
exclude:
groups:
- "appSamples"
- "macOnly"
- "windowsOnly"
- "artefacts"
Expand Down Expand Up @@ -85,6 +93,7 @@ filterConfigs:
- "modules/perfview/**/FastSerialization.csproj"
exclude:
groups:
- "appSamples"
- "artefacts"
- "trimTests"
- "playwrightTests"
Expand All @@ -103,6 +112,7 @@ filterConfigs:
- "modules/perfview/**/FastSerialization.csproj"
exclude:
groups:
- "appSamples"
- "macOnly"
- "artefacts"
- "trimTests"
Expand All @@ -125,6 +135,7 @@ filterConfigs:
- "modules/perfview/**/FastSerialization.csproj"
exclude:
groups:
- "appSamples"
- "macOnly"
- "artefacts"
- "trimTests"
Expand All @@ -142,6 +153,18 @@ filterConfigs:
- "**/*Sentry.DiagnosticSource.Tests.csproj"
- "**/*Sentry.EntityFramework.Tests.csproj"

- outputPath: Sentry-CI-Build-Samples-macOS.slnf
include:
groups:
- "appSamples"

# The app samples the Linux build leg built before they moved to their own job
- outputPath: Sentry-CI-Build-Samples-Linux.slnf
include:
patterns:
- "**/Sentry.Samples.Android.csproj"
- "**/Sentry.Samples.Maui.csproj"

- outputPath: Sentry-CI-CodeQL.slnf
include:
groups:
Expand Down
Loading