Skip to content

Commit 1d16e00

Browse files
bruno-garciavaindjamescrosswellbitsandfoxesdependabot[bot]
authored
build with dotnet 8 sdk (#2622)
Co-authored-by: Ivan Dlugos <[email protected]> Co-authored-by: James Crosswell <[email protected]> Co-authored-by: Ivan Dlugos <[email protected]> Co-authored-by: Stefan Jandl <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> fix build on mac m1 (#2702) Fix: Scope not being applied to OpenTelemetry spans in ASP.NET Core (#2690)
1 parent 5aa3280 commit 1d16e00

File tree

7 files changed

+77
-37
lines changed

7 files changed

+77
-37
lines changed

.github/actions/environment/action.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,15 @@ runs:
1717
distribution: 'temurin'
1818
java-version: '11'
1919

20-
# .NET 3.1 has been removed from all OS due to EOL
21-
# https://github.com/actions/runner-images/issues/7667
22-
- name: Install .NET 3.1 SDK
20+
- name: Install .NET SDK
2321
uses: actions/setup-dotnet@v3
2422
with:
25-
dotnet-version: 3.1.x
26-
27-
- name: Install .NET 7 SDK
28-
uses: actions/setup-dotnet@v3
29-
with:
30-
dotnet-version: 7.0.203 # switch back to 7.x.x after resolving the below Tizen issue.
31-
32-
# Workaround for Tizen issue
33-
# See https://github.com/dotnet/sdk/issues/33192
34-
- name: Pin to .NET SDK 7.0.203
35-
run: dotnet new globaljson --sdk-version 7.0.203 --force
36-
shell: bash
37-
23+
dotnet-version: |
24+
3.1.x
25+
6.0.x
26+
7.0.x
27+
8.0.100-rc.2.23502.2
28+
3829
- name: Dependency Caching
3930
uses: actions/cache@v3
4031
# Cache is too slow on Windows to be useful. See https://github.com/actions/cache/issues/752
@@ -51,14 +42,19 @@ runs:
5142
run: >
5243
dotnet workload install \
5344
maui-android \
54-
${{ runner.os == 'macOS' && 'maui-ios maui-maccatalyst maui-windows maui-tizen' || '' }} \
45+
${{ runner.os == 'macOS' && 'maui-ios maui-maccatalyst maui-windows' || '' }} \
5546
${{ runner.os == 'Windows' && 'maui-windows' || '' }} \
5647
--temp-dir "${{ runner.temp }}" --from-rollback-file rollback.json
5748
58-
# We build Sentry.Maui for every supported MAUI target so we can access platform-specific features.
59-
# That includes Tizen. We don't need the entire Tizen SDK, but we do need the base Tizen workload.
60-
# Though we could install it on all runners, we really only need it when building and packing for NuGet, which we do on macOS only.
61-
- name: Install Tizen Workload
62-
if: runner.os == 'macOS'
49+
- name: Restore workloads
50+
shell: bash
51+
run: dotnet workload restore
52+
53+
- name: Update workloads
54+
shell: bash
55+
run: dotnet workload update
56+
57+
- name: Log what we have in the workloads
6358
shell: bash
64-
run: "curl -sSL https://raw.githubusercontent.com/Samsung/Tizen.NET/main/workload/scripts/workload-install.sh | sudo bash"
59+
run: dotnet workload update
60+

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
os: [ubuntu-latest, windows-latest, macos-latest]
18+
os: [ubuntu-latest, windows-latest, macos-13]
1919

2020
steps:
2121
- name: Cancel Previous Runs

GlobalUsings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
global using System.IO.MemoryMappedFiles;
1414
global using System.Net;
1515
global using System.Net.Http.Headers;
16+
global using System.Net.Http;
1617
global using System.Net.NetworkInformation;
1718
global using System.Net.Sockets;
1819
global using System.Reflection;

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "7.0.100",
3+
"version": "8.0.*",
44
"rollForward": "latestMinor",
5-
"allowPrerelease": false
5+
"allowPrerelease": true
66
}
77
}

src/Sentry.Maui/Sentry.Maui.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Target net6.0 so we can run unit tests on platform-neutral code.
77
Target other platforms so we can include platform-specific code, and bundle native SDKs.
88
-->
9-
<TargetFrameworks>net6.0</TargetFrameworks>
9+
<TargetFrameworks>net7.0</TargetFrameworks>
1010
<TargetFrameworks Condition="'$(NO_ANDROID)' == ''">$(TargetFrameworks);net7.0-android</TargetFrameworks>
1111
<TargetFrameworks Condition="'$(NO_IOS)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-ios</TargetFrameworks>
1212
<TargetFrameworks Condition="'$(NO_MACCATALYST)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks>

test/Sentry.Maui.Tests/Sentry.Maui.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net7.0</TargetFrameworks>
55
<TargetFrameworks Condition="'$(NO_ANDROID)' == ''">$(TargetFrameworks);net7.0-android</TargetFrameworks>
66
<TargetFrameworks Condition="'$(NO_IOS)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-ios</TargetFrameworks>
77
<TargetFrameworks Condition="'$(NO_MACCATALYST)' == '' And $([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks>

test/sentry-cli-integration.Tests.ps1

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,49 @@ if (!(Test-Path env:CI ))
99
Import-Module $PSScriptRoot/../../github-workflows/sentry-cli/integration-test/action.psm1 -Force
1010
}
1111

12+
function Should-AnyElementMatch ($ActualValue, [string]$ExpectedValue, [switch] $Negate, [string] $Because)
13+
{
14+
<#
15+
.SYNOPSIS
16+
Asserts whether any item in the collection matches the expected value
17+
.EXAMPLE
18+
'foo','bar','foobar' | Should -AnyElementMatch 'oob'
19+
20+
This should pass because 'oob' is a substring of 'foobar'.
21+
#>
22+
23+
$filtered = $ActualValue | Where-Object { $_ -match $ExpectedValue }
24+
[bool] $succeeded = @($filtered).Count -gt 0
25+
if ($Negate) { $succeeded = -not $succeeded }
26+
27+
if (-not $succeeded)
28+
{
29+
if ($Negate)
30+
{
31+
$failureMessage = "Expected string '$ExpectedValue' to match no elements in collection @($($ActualValue -join ', '))$(if($Because) { " because $Because"})."
32+
}
33+
else
34+
{
35+
$failureMessage = "Expected string '$ExpectedValue' to match any element in collection @($($ActualValue -join ', '))$(if($Because) { " because $Because"})."
36+
}
37+
}
38+
39+
return [pscustomobject]@{
40+
Succeeded = $succeeded
41+
FailureMessage = $failureMessage
42+
}
43+
}
44+
45+
BeforeDiscovery {
46+
Add-ShouldOperator -Name AnyElementMatch `
47+
-InternalName 'Should-AnyElementMatch' `
48+
-Test ${function:Should-AnyElementMatch} `
49+
-SupportsArrayInput
50+
}
51+
1252
BeforeAll {
53+
$env:SENTRY_LOG_LEVEL = 'debug';
54+
1355
function DotnetBuild([string]$Sample, [bool]$Symbols, [bool]$Sources, [string]$TargetFramework = '')
1456
{
1557
$rootDir = "$(Get-Item $PSScriptRoot/../../)"
@@ -58,8 +100,8 @@ Describe 'CLI-integration' {
58100
$result.HasErrors() | Should -BeFalse
59101
$result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @(
60102
'Sentry.pdb',
61-
'Sentry.Samples.Console.Basic.pdb',
62-
'Sentry.Samples.Console.Basic.src.zip')
103+
'Sentry.Samples.Console.Basic.pdb')
104+
$result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Console.Basic/Program.cs'
63105
}
64106

65107
It "uploads symbols for a console app build" {
@@ -75,8 +117,8 @@ Describe 'CLI-integration' {
75117
$result = DotnetBuild 'Sentry.Samples.Console.Basic' $False $True
76118
$result.ScriptOutput | Should -Contain 'Build succeeded.'
77119
$result.HasErrors() | Should -BeFalse
78-
$result.UploadedDebugFiles() | Sort-Object -Unique | Should -Be @(
79-
'Sentry.Samples.Console.Basic.src.zip')
120+
$result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Console.Basic/Program.cs'
121+
$result.UploadedDebugFiles() | Should -BeNullOrEmpty
80122
}
81123

82124
It "uploads nothing for a console app build when disabled" {
@@ -96,12 +138,13 @@ Describe 'CLI-integration' {
96138
'Sentry.Extensions.Logging.pdb',
97139
'Sentry.Maui.pdb',
98140
'Sentry.pdb',
99-
'Sentry.Samples.Maui.pdb',
100-
'Sentry.Samples.Maui.src.zip'
141+
'Sentry.Samples.Maui.pdb'
101142
)
143+
$result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs'
102144
}
103145

104-
if (![RuntimeInformation]::IsOSPlatform([OSPlatform]::OSX)) {
146+
if (![RuntimeInformation]::IsOSPlatform([OSPlatform]::OSX))
147+
{
105148
# Remaining tests run on macOS only
106149
return
107150
}
@@ -127,8 +170,8 @@ Describe 'CLI-integration' {
127170
'Sentry.Maui.pdb',
128171
'Sentry.pdb',
129172
'Sentry.Samples.Maui',
130-
'Sentry.Samples.Maui.pdb',
131-
'Sentry.Samples.Maui.src.zip'
173+
'Sentry.Samples.Maui.pdb'
132174
)
175+
$result.ScriptOutput | Should -AnyElementMatch 'Skipping embedded source file: .*/samples/Sentry.Samples.Maui/MauiProgram.cs'
133176
}
134177
}

0 commit comments

Comments
 (0)