test: sync net11.0 verify snapshots with #5504 #14640
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| workflow_dispatch: | |
| # While we track a .NET preview or RC, the runtime-deps tag the SDK derives from the runtime | |
| # version doesn't exist yet, so the container integration tests have to be told which image to | |
| # use. Which runtimes need pinning varies by release: for .NET 10 it was only linux-musl, for | |
| # .NET 11 the glibc runtimes need it too because the images moved from noble to resolute. | |
| # | |
| # At GA, blank these two values - do NOT delete them or the steps that use them. They are needed | |
| # again for every subsequent preview. An empty value is ignored (see integration-test/aot.Tests.ps1), | |
| # so the SDK goes back to deriving the tag itself. | |
| # | |
| # See CONTRIBUTING.md -> "Upgrading to a new .NET major version". | |
| env: | |
| CONTAINER_BASE_IMAGE_GLIBC: 'mcr.microsoft.com/dotnet/runtime-deps:11.0-preview-resolute-chiseled' | |
| CONTAINER_BASE_IMAGE_MUSL: 'mcr.microsoft.com/dotnet/runtime-deps:11.0-preview-alpine' | |
| jobs: | |
| build-sentry-native: | |
| name: sentry-native (${{ matrix.rid }}) | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| rid: linux-x64 | |
| - os: ubuntu-22.04-arm | |
| rid: linux-arm64 | |
| - os: ubuntu-latest | |
| rid: linux-musl-x64 | |
| container: | |
| image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 | |
| - os: ubuntu-24.04-arm | |
| rid: linux-musl-arm64 | |
| container: | |
| image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 | |
| volumes: | |
| - /tmp/node20:/__e/node20 | |
| - /tmp/node24:/__e/node24 | |
| - os: macos-26 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 | |
| rid: macos # universal (osx-arm64 + osx-x64) | |
| - os: windows-latest | |
| rid: win-x64 | |
| - os: windows-11-arm | |
| rid: win-arm64 | |
| steps: | |
| - name: Initialize Alpine Linux | |
| if: ${{ contains(matrix.container.image, 'alpine') }} | |
| # Enable JavaScript Actions in Alpine containers on Arm64 runners | |
| # See https://github.com/getsentry/sentry-dotnet/pull/5455 | |
| run: | | |
| if [ "$(uname -m)" != "x86_64" ]; then | |
| for node in /__e/node*; do | |
| sudo mkdir -p "$node/bin" | |
| sudo ln -s /usr/bin/node "$node/bin/node" | |
| sudo ln -s /usr/bin/npm "$node/bin/npm" | |
| done | |
| sudo sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - run: git submodule update --init modules/sentry-native | |
| - id: cache | |
| uses: actions/cache@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') }} | |
| enableCrossOsArchive: true | |
| - run: scripts/build-sentry-native.ps1 | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| shell: pwsh | |
| build-sentry: | |
| needs: build-sentry-native | |
| name: .NET (${{ matrix.rid }}) | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| rid: linux-x64 | |
| slnf: Sentry-CI-Build-Linux.slnf | |
| - os: ubuntu-22.04-arm | |
| rid: linux-arm64 | |
| slnf: Sentry-CI-Build-Linux-NoMobile.slnf | |
| - os: ubuntu-latest | |
| rid: linux-musl-x64 | |
| slnf: Sentry-CI-Build-Linux-NoMobile.slnf | |
| container: | |
| image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| - os: ubuntu-24.04-arm | |
| rid: linux-musl-arm64 | |
| slnf: Sentry-CI-Build-Linux-NoMobile.slnf | |
| container: | |
| image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21 | |
| volumes: | |
| - /tmp/node20:/__e/node20 | |
| - /tmp/node24:/__e/node24 | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| - os: macos-26 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703 | |
| rid: macos # universal (osx-arm64 + osx-x64) | |
| slnf: Sentry-CI-Build-macOS.slnf | |
| - os: windows-latest | |
| rid: win-x64 | |
| slnf: Sentry-CI-Build-Windows.slnf | |
| - os: windows-11-arm | |
| rid: win-arm64 | |
| slnf: Sentry-CI-Build-Windows-arm64.slnf | |
| steps: | |
| - name: Initialize Alpine Linux | |
| if: ${{ contains(matrix.container.image, 'alpine') }} | |
| # Enable JavaScript Actions in Alpine containers on Arm64 runners | |
| # See https://github.com/getsentry/sentry-dotnet/pull/5455 | |
| run: | | |
| if [ "$(uname -m)" != "x86_64" ]; then | |
| for node in /__e/node*; do | |
| sudo mkdir -p "$node/bin" | |
| sudo ln -s /usr/bin/node "$node/bin/node" | |
| sudo ln -s /usr/bin/npm "$node/bin/npm" | |
| done | |
| sudo sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release | |
| fi | |
| - name: Cancel Previous Runs | |
| if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') | |
| uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1 | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 2 # default is 1 and codecov needs > 1 | |
| - name: Remove unused applications | |
| if: ${{ !matrix.container }} | |
| uses: ./.github/actions/freediskspace | |
| - name: Setup Environment | |
| uses: ./.github/actions/environment | |
| # We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages | |
| - name: Set Environment Variables | |
| if: runner.os == 'macOS' | |
| run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV | |
| - name: Download sentry-native (linux-x64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'linux-x64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-linux-x64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Download sentry-native (linux-arm64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'linux-arm64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-linux-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Download sentry-native (linux-musl-x64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'linux-musl-x64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-linux-musl-x64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Download sentry-native (linux-musl-arm64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'linux-musl-arm64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-linux-musl-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Download sentry-native (macos) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'macos') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-macos-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Download sentry-native (win-x64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'win-x64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-win-x64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| enableCrossOsArchive: true | |
| - name: Download sentry-native (win-arm64) | |
| if: ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.rid == 'win-arm64') }} | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-win-arm64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| enableCrossOsArchive: true | |
| - name: Build Native Dependencies | |
| if: ${{ !matrix.container && !env.NO_MOBILE }} | |
| uses: ./.github/actions/buildnative | |
| - name: Restore .NET Dependencies | |
| run: dotnet restore ${{ matrix.slnf }} --nologo | |
| - name: Build | |
| id: build | |
| run: dotnet build ${{ matrix.slnf }} -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog | |
| - name: Upload build logs | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.rid }}-build-logs | |
| path: | | |
| build.log | |
| build.binlog | |
| if-no-files-found: ignore | |
| - name: Free disk space before tests | |
| if: ${{ contains(matrix.container.image, 'alpine') }} | |
| run: | | |
| echo "Disk usage before cleanup:" | |
| df -h | |
| # Remove build binlog (can be large, often 100MB+) | |
| rm -f build.binlog || true | |
| # Clean up NuGet HTTP cache (not the packages cache which is needed for pack) | |
| dotnet nuget locals http-cache --clear || true | |
| echo "Disk usage after cleanup:" | |
| df -h | |
| - name: Test | |
| run: dotnet test ${{ matrix.slnf }} -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage" | |
| - name: Upload code coverage | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload build and test outputs | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.rid }}-verify-test-results | |
| path: "**/*.received.*" | |
| - name: Create NuGet Packages | |
| run: dotnet pack ${{ matrix.slnf }} -c Release --no-build --nologo | |
| - name: Archive NuGet Packages | |
| if: env.CI_PUBLISHING_BUILD == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ github.sha }} | |
| if-no-files-found: error | |
| path: | | |
| src/**/Release/*.nupkg | |
| src/**/Release/*.snupkg | |
| - name: Sparse checkout | |
| if: env.CI_PUBLISHING_BUILD == 'true' | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| # We only check out what is absolutely necessary to reduce a chance of local files impacting | |
| # integration tests (nuget.config etc.)... But we need the root Directory.Build.props calculate | |
| # the package version | |
| sparse-checkout: | | |
| integration-test | |
| scripts | |
| .github | |
| - name: Fetch NuGet Packages | |
| if: env.CI_PUBLISHING_BUILD == 'true' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: ${{ github.sha }} | |
| path: src | |
| # ContainerBaseImage comes from the workflow-level env block at the top of this file. | |
| - name: Integration test | |
| # TODO: Re-enable linux-musl-x64 once we have resolved https://github.com/getsentry/sentry-dotnet/issues/4788 | |
| if: ${{ (matrix.rid != 'linux-musl-x64') && (matrix.rid != 'linux-musl-arm64') }} | |
| env: | |
| ContainerBaseImage: ${{ env.CONTAINER_BASE_IMAGE_GLIBC }} | |
| uses: getsentry/github-workflows/sentry-cli/integration-test@607fed74f812e69201531a5185b6c3c57caa4e89 # 3.4.0 | |
| with: | |
| path: integration-test | |
| - name: Integration test (musl) | |
| # TODO: Include linux-musl-x64 once we have resolved https://github.com/getsentry/sentry-dotnet/issues/4788 | |
| if: ${{ (matrix.rid == 'linux-musl-arm64') }} | |
| uses: getsentry/github-workflows/sentry-cli/integration-test@607fed74f812e69201531a5185b6c3c57caa4e89 # 3.4.0 | |
| env: | |
| ContainerBaseImage: ${{ env.CONTAINER_BASE_IMAGE_MUSL }} | |
| with: | |
| path: integration-test | |
| ms-build: | |
| needs: build-sentry-native | |
| name: MSBuild | |
| runs-on: windows-2025-vs2026 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Download sentry-native (win-x64) | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-win-x64-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| enableCrossOsArchive: true | |
| - name: Setup Environment | |
| uses: ./.github/actions/environment | |
| - name: Build Native Dependencies | |
| uses: ./.github/actions/buildnative | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 | |
| - name: Run MSBuild | |
| 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 | |
| - name: Test MSBuild | |
| uses: getsentry/github-workflows/sentry-cli/integration-test@607fed74f812e69201531a5185b6c3c57caa4e89 # 3.4.0 | |
| with: | |
| path: integration-test/msbuild.Tests.ps1 | |
| - name: Upload logs | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ runner.os }}-msbuild-logs | |
| path: | | |
| msbuild.log | |
| msbuild.binlog | |
| if-no-files-found: ignore | |
| # Unsupported Native AOT runtimes should have SentryNative auto-disabled | |
| # to avoid native library loading errors on startup. | |
| unsupported-aot: | |
| needs: build-sentry | |
| name: Unsupported AOT (${{ matrix.rid }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04-arm | |
| rid: linux-arm | |
| - os: windows-latest | |
| rid: win-x86 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Setup Environment | |
| uses: ./.github/actions/environment | |
| - name: Build Native Dependencies | |
| if: ${{ !env.NO_MOBILE }} | |
| uses: ./.github/actions/buildnative | |
| - name: Fetch NuGet Packages | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: ${{ github.sha }} | |
| path: src | |
| - name: Test AOT | |
| uses: getsentry/github-workflows/sentry-cli/integration-test@607fed74f812e69201531a5185b6c3c57caa4e89 # 3.4.0 | |
| env: | |
| RuntimeIdentifier: ${{ matrix.rid }} | |
| # aot.Tests.ps1 has the Container test, so it needs the same pin. | |
| # The glibc tag covers linux/arm/v7; win-x86 skips the Container test. | |
| ContainerBaseImage: ${{ env.CONTAINER_BASE_IMAGE_GLIBC }} | |
| with: | |
| path: integration-test/aot.Tests.ps1 | |
| trim-analysis: | |
| needs: build-sentry-native | |
| name: Trim analysis | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 2 # default is 1 and codecov needs > 1 | |
| # We use macOS for the final publishing build so we get all the iOS/Mac Catalyst targets in the packages | |
| - name: Set Environment Variables | |
| run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV | |
| - name: Download sentry-native (macos) | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: src/Sentry/Platforms/Native/sentry-native | |
| key: sentry-native-macos-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }} | |
| fail-on-cache-miss: true | |
| - name: Setup Environment | |
| uses: ./.github/actions/environment | |
| - name: Build Native Dependencies | |
| uses: ./.github/actions/buildnative | |
| - name: Publish Test app (macOS) | |
| run: dotnet publish test/Sentry.TrimTest/Sentry.TrimTest.csproj -c Release -r osx-arm64 -p:NO_MOBILE=true | |
| - name: Publish Test app (Android) | |
| run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net10.0-android36.0 -r android-arm64 | |
| # We can't publish iOS applications on CI yet. We'd need a valid bundle identifier and to install the relevant | |
| # certificates/profiles on CI (presumably certs associated with the Sentry org). | |
| # See https://youtrack.jetbrains.com/issue/RIDER-17115/Could-not-find-any-available-provisioning-profiles-for-iOS | |
| # - name: Publish Test app (iOS) | |
| # run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net10.0-ios26 -r ios-arm64 | |
| test-solution-filters: | |
| runs-on: ubuntu-22.04 | |
| if: ${{ !startsWith(github.ref_name, 'release/') }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Rebuild Solution Filters | |
| shell: pwsh | |
| run: pwsh scripts/generate-solution-filters.ps1 | |
| - name: Ensure Solution Filters are up to date | |
| shell: pwsh | |
| run: scripts/dirty-check.ps1 -PathToCheck ./*.sln* -GuidanceOnFailure "Uncommitted changes to the solution filters detected. Run `scripts/generate-solution-filters.ps1` locally and commit changes." |