Skip to content

Commit 9eaaa15

Browse files
authored
chore: optimize the CI flow (#4247)
1 parent 0e91597 commit 9eaaa15

3 files changed

Lines changed: 13 additions & 36 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ jobs:
183183
name: ${{ matrix.target || runner.os }}-verify-test-results
184184
path: "**/*.received.*"
185185

186-
# To save time and disk space, we only create and archive the NuGet packages when we're actually releasing.
187-
188186
- name: Create NuGet Packages
189-
if: env.CI_PUBLISHING_BUILD == 'true'
190187
run: dotnet pack Sentry-CI-Build-${{ matrix.target || runner.os }}.slnf -c Release --no-build --nologo
191188

192189
- name: Archive NuGet Packages
@@ -199,44 +196,24 @@ jobs:
199196
src/**/Release/*.nupkg
200197
src/**/Release/*.snupkg
201198
202-
integration-test:
203-
needs: build
204-
name: Integration test (${{ matrix.container || matrix.os }})
205-
runs-on: ${{ matrix.os }}
206-
container: ${{ matrix.container }}
207-
208-
strategy:
209-
fail-fast: false
210-
matrix:
211-
include:
212-
- os: ubuntu-22.04 # Pin ubuntu to ensure mono is installed
213-
- os: ubuntu-22.04-arm
214-
- os: ubuntu-latest
215-
container: ghcr.io/getsentry/sentry-dotnet-alpine:3.21
216-
- os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
217-
- os: windows-latest
218-
- os: windows-11-arm
219-
220-
steps:
221-
- uses: actions/checkout@v4
199+
- name: Sparse checkout
200+
if: env.CI_PUBLISHING_BUILD == 'true'
201+
uses: actions/checkout@v4
222202
with:
223203
# We only check out what is absolutely necessary to reduce a chance of local files impacting
224204
# integration tests, e.g. Directory.Build.props, nuget.config, ...
225205
sparse-checkout: |
226-
Directory.Build.props
227206
integration-test
228207
.github
229208
230209
- name: Fetch NuGet Packages
210+
if: env.CI_PUBLISHING_BUILD == 'true'
231211
uses: actions/download-artifact@v4
232212
with:
233213
name: ${{ github.sha }}
234214
path: src
235215

236-
- name: Setup Environment
237-
uses: ./.github/actions/environment
238-
239-
- name: Test
216+
- name: Integration test
240217
uses: getsentry/github-workflows/sentry-cli/integration-test/@v2
241218
with:
242219
path: integration-test

src/Sentry.Maui/Sentry.Maui.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
-->
1919
<EnableWindowsTargeting Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</EnableWindowsTargeting>
2020

21-
<!-- We'll need to package this only on OSX, so we get the iOS native support. -->
22-
<IsPackable Condition="!$([MSBuild]::IsOSPlatform('OSX'))">false</IsPackable>
21+
<!-- We'll need to package this only for builds including mobile targets. -->
22+
<IsPackable Condition="'$(NO_MOBILE)' == 'true'">false</IsPackable>
2323

2424
<!--
2525
Imports MAUI dependencies.

src/Sentry/Platforms/Native/Sentry.Native.targets

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,36 @@
3333
<None Include="$(MSBuildThisFileDirectory)buildTransitive\Sentry.Native.targets" Pack="true" PackagePath="build\Sentry.Native.targets" />
3434
</ItemGroup>
3535

36-
<!-- Packaging the native library -->
37-
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(RuntimeIdentifier)' == 'win-x64'">
36+
<!-- Packaging the native library (NOTE: $(RuntimeIdentifier) is not set) -->
37+
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'win-x64'">
3838
<None Include="$(SentryNativeOutputDirectory-win-x64)$(SentryNativeLibraryName).lib">
3939
<Pack>true</Pack>
4040
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-x64)</PackagePath>
4141
</None>
4242
</ItemGroup>
4343

44-
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(RuntimeIdentifier)' == 'win-arm64'">
44+
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'win-arm64'">
4545
<None Include="$(SentryNativeOutputDirectory-win-arm64)$(SentryNativeLibraryName).lib">
4646
<Pack>true</Pack>
4747
<PackagePath>\sentry-native\$(NativeLibRelativePath-win-arm64)</PackagePath>
4848
</None>
4949
</ItemGroup>
5050

51-
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(RuntimeIdentifier)' == 'linux-x64'">
51+
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-x64'">
5252
<None Include="$(SentryNativeOutputDirectory-linux-x64)lib$(SentryNativeLibraryName).a">
5353
<Pack>true</Pack>
5454
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-x64)</PackagePath>
5555
</None>
5656
</ItemGroup>
5757

58-
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(RuntimeIdentifier)' == 'linux-musl-x64'">
58+
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-musl-x64'">
5959
<None Include="$(SentryNativeOutputDirectory-linux-musl-x64)lib$(SentryNativeLibraryName).a">
6060
<Pack>true</Pack>
6161
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-musl-x64)</PackagePath>
6262
</None>
6363
</ItemGroup>
6464

65-
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$(RuntimeIdentifier)' == 'linux-arm64'">
65+
<ItemGroup Condition="'$(CI_PUBLISHING_BUILD)' == 'true' or '$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)' == 'linux-arm64'">
6666
<None Include="$(SentryNativeOutputDirectory-linux-arm64)lib$(SentryNativeLibraryName).a">
6767
<Pack>true</Pack>
6868
<PackagePath>\sentry-native\$(NativeLibRelativePath-linux-arm64)</PackagePath>

0 commit comments

Comments
 (0)