ScopeExtensions.Populate is now internal #11874
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: | |
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-15 # 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') }} | |
run: | | |
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- run: git submodule update --init modules/sentry-native | |
# zstd is needed for cross OS actions/cache but missing from windows-11-arm | |
# https://github.com/actions/partner-runner-images/issues/99 | |
- name: Install zstd on Windows ARM64 | |
uses: ./.github/actions/install-zstd | |
- uses: actions/cache@v4 | |
id: cache | |
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-15 # 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') }} | |
run: | | |
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin | |
- name: Cancel Previous Runs | |
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') | |
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1 | |
- name: Checkout | |
uses: actions/checkout@v5 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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 }} | |
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@v4 | |
with: | |
name: ${{ matrix.rid }}-build-logs | |
path: | | |
build.log | |
build.binlog | |
if-no-files-found: ignore | |
- 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@5a1091511ad55cbe89839c7260b706298ca349f7 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload build and test outputs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
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@v4 | |
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@v5 | |
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 | |
.github | |
- name: Fetch NuGet Packages | |
if: env.CI_PUBLISHING_BUILD == 'true' | |
uses: actions/download-artifact@v5 | |
with: | |
name: ${{ github.sha }} | |
path: src | |
- name: Integration test | |
if: ${{ (matrix.rid != 'linux-musl-x64') && (matrix.rid != 'linux-musl-arm64') }} | |
uses: getsentry/github-workflows/sentry-cli/integration-test/@a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1 | |
with: | |
path: integration-test | |
# For the linux-musl runtimes we have to pin the ContainerBaseImage for preview or RC builds, since | |
# these don't conform to the normal naming conventions and don't get resolved automatically. We do | |
# by passing it as parameter to aot.Tests.ps1 via an environment variable | |
- name: Integration test (musl) | |
if: ${{ (matrix.rid == 'linux-musl-x64') || (matrix.rid == 'linux-musl-arm64') }} | |
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2 | |
env: | |
ContainerBaseImage: 'mcr.microsoft.com/dotnet/nightly/runtime-deps:10.0-preview-alpine3.22' | |
with: | |
path: integration-test | |
ms-build: | |
needs: build-sentry-native | |
name: MSBuild | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
submodules: recursive | |
- name: Download sentry-native (win-x64) | |
uses: actions/cache/restore@v4 | |
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@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2 | |
- 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/@a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1 | |
with: | |
path: integration-test/msbuild.Tests.ps1 | |
- name: Upload logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
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@v5 | |
with: | |
submodules: recursive | |
- name: Setup Environment | |
uses: ./.github/actions/environment | |
- name: Build Native Dependencies | |
uses: ./.github/actions/buildnative | |
- name: Fetch NuGet Packages | |
uses: actions/download-artifact@v5 | |
with: | |
name: ${{ github.sha }} | |
path: src | |
- name: Test AOT | |
uses: getsentry/github-workflows/sentry-cli/integration-test/@a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1 | |
env: | |
RuntimeIdentifier: ${{ matrix.rid }} | |
with: | |
path: integration-test/aot.Tests.ps1 | |
trim-analysis: | |
needs: build-sentry-native | |
name: Trim analysis | |
runs-on: macos-15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
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@v4 | |
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 net9.0-android35.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 net9.0-ios18.0 -r ios-arm64 | |
test-solution-filters: | |
runs-on: ubuntu-22.04 | |
if: ${{ !startsWith(github.ref_name, 'release/') }} | |
steps: | |
- uses: actions/checkout@v5 | |
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." |