11
11
12
12
jobs :
13
13
build-sentry-native :
14
- name : sentry-native (${{ matrix.os }})
14
+ name : sentry-native (${{ matrix.container || matrix. os }})
15
15
runs-on : ${{ matrix.os }}
16
+ container : ${{ matrix.container }}
16
17
strategy :
17
18
fail-fast : false
18
19
matrix :
19
- # Pin ubuntu to ensure mono is installed
20
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
21
- os : [ubuntu-22.04, windows-latest, macos-15]
20
+ include :
21
+ - os : ubuntu-22.04 # Pin ubuntu to ensure mono is installed
22
+ target : Linux
23
+ - os : ubuntu-latest
24
+ container : ghcr.io/getsentry/sentry-dotnet-alpine:3.21
25
+ target : Linux-musl
26
+ - os : windows-latest
27
+ - os : macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
22
28
23
29
steps :
24
30
- name : Checkout
@@ -30,14 +36,15 @@ jobs:
30
36
id : cache
31
37
with :
32
38
path : src/Sentry/Platforms/Native/sentry-native
33
- key : sentry-native-${{ runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
39
+ key : sentry-native-${{ matrix.target || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
34
40
enableCrossOsArchive : true
35
41
36
42
- name : Remove unused applications
43
+ if : ${{ !matrix.container }}
37
44
uses : ./.github/actions/freediskspace
38
45
39
46
- name : Install build dependencies
40
- if : steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
47
+ if : steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux' && !matrix.container
41
48
run : |
42
49
sudo apt update
43
50
sudo apt install libcurl4-openssl-dev
@@ -48,15 +55,21 @@ jobs:
48
55
49
56
build :
50
57
needs : build-sentry-native
51
- name : .NET (${{ matrix.os }})
58
+ name : .NET (${{ matrix.container || matrix. os }})
52
59
runs-on : ${{ matrix.os }}
60
+ container : ${{ matrix.container }}
53
61
54
62
strategy :
55
63
fail-fast : false
56
64
matrix :
57
- # Pin ubuntu to ensure mono is installed
58
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
59
- os : [ubuntu-22.04, windows-latest, macos-15]
65
+ include :
66
+ - os : ubuntu-22.04 # Pin ubuntu to ensure mono is installed
67
+ target : Linux
68
+ - os : ubuntu-latest
69
+ container : ghcr.io/getsentry/sentry-dotnet-alpine:3.21
70
+ target : Linux-musl
71
+ - os : windows-latest
72
+ - os : macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
60
73
61
74
steps :
62
75
- name : Cancel Previous Runs
70
83
fetch-depth : 2 # default is 1 and codecov needs > 1
71
84
72
85
- name : Remove unused applications
86
+ if : ${{ !matrix.container }}
73
87
uses : ./.github/actions/freediskspace
74
88
75
89
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages
@@ -78,13 +92,21 @@ jobs:
78
92
run : echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV
79
93
80
94
- name : Download sentry-native (Linux)
81
- if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'Linux') }}
95
+ if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.target == 'Linux') }}
82
96
uses : actions/cache/restore@v4
83
97
with :
84
98
path : src/Sentry/Platforms/Native/sentry-native
85
99
key : sentry-native-Linux-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
86
100
fail-on-cache-miss : true
87
101
102
+ - name : Download sentry-native (Linux musl)
103
+ if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (matrix.target == 'Linux-musl') }}
104
+ uses : actions/cache/restore@v4
105
+ with :
106
+ path : src/Sentry/Platforms/Native/sentry-native
107
+ key : sentry-native-Linux-musl-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
108
+ fail-on-cache-miss : true
109
+
88
110
- name : Download sentry-native (macOS)
89
111
if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'macOS') }}
90
112
uses : actions/cache/restore@v4
@@ -106,24 +128,25 @@ jobs:
106
128
uses : ./.github/actions/environment
107
129
108
130
- name : Build Native Dependencies
131
+ if : ${{ !matrix.container }}
109
132
uses : ./.github/actions/buildnative
110
133
111
134
- name : Restore .NET Dependencies
112
- run : dotnet restore Sentry-CI-Build-${{ runner.os }}.slnf --nologo
135
+ run : dotnet restore Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf --nologo
113
136
114
137
- name : Build
115
138
id : build
116
- run : dotnet build Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog
139
+ run : dotnet build Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-restore --nologo -v:minimal -flp:logfile=build.log -p:CopyLocalLockFileAssemblies=true -bl:build.binlog
117
140
118
141
- name : Upload build logs
119
142
if : ${{ steps.build.outcome != 'skipped' }}
120
143
uses : actions/upload-artifact@v4
121
144
with :
122
- name : ${{ runner.os }}-build-logs
145
+ name : ${{ matrix.target || runner.os }}-build-logs
123
146
path : build.binlog
124
147
125
148
- name : Test
126
- run : dotnet test Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage"
149
+ run : dotnet test Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-build --nologo -l GitHubActions -l "trx;LogFilePrefix=testresults_${{ runner.os }}" --collect "XPlat Code Coverage"
127
150
128
151
- name : Upload code coverage
129
152
uses : codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d
@@ -132,14 +155,14 @@ jobs:
132
155
if : failure()
133
156
uses : actions/upload-artifact@v4
134
157
with :
135
- name : ${{ runner.os }}-verify-test-results
158
+ name : ${{ matrix.target || runner.os }}-verify-test-results
136
159
path : " **/*.received.*"
137
160
138
161
# To save time and disk space, we only create and archive the Nuget packages when we're actually releasing.
139
162
140
163
- name : Create Nuget Packages
141
164
if : env.CI_PUBLISHING_BUILD == 'true'
142
- run : dotnet pack Sentry-CI-Build-${{ runner.os }}.slnf -c Release --no-build --nologo
165
+ run : dotnet pack Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-build --nologo
143
166
144
167
- name : Archive Nuget Packages
145
168
if : env.CI_PUBLISHING_BUILD == 'true'
@@ -153,15 +176,20 @@ jobs:
153
176
154
177
integration-test :
155
178
needs : build
156
- name : Integration test (${{ matrix.os }})
179
+ name : Integration test (${{ matrix.container || matrix. os }})
157
180
runs-on : ${{ matrix.os }}
181
+ container : ${{ matrix.container }}
158
182
159
183
strategy :
160
184
fail-fast : false
161
185
matrix :
162
- # Pin ubuntu to ensure mono is installed
163
- # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
164
- os : [ubuntu-22.04, windows-latest, macos-15]
186
+ include :
187
+ - os : ubuntu-22.04 # Pin ubuntu to ensure mono is installed
188
+ - os : ubuntu-latest
189
+ container : ghcr.io/getsentry/sentry-dotnet-alpine:3.21
190
+ target : Linux-musl
191
+ - os : windows-latest
192
+ - os : macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
165
193
166
194
steps :
167
195
- uses : actions/checkout@v4
@@ -180,7 +208,7 @@ jobs:
180
208
path : src
181
209
182
210
- name : Install build dependencies
183
- if : runner.os == 'Linux'
211
+ if : runner.os == 'Linux' && !matrix.container
184
212
run : |
185
213
sudo apt update
186
214
sudo apt install libcurl4-openssl-dev
0 commit comments