11
11
12
12
jobs :
13
13
build-sentry-native :
14
- name : sentry-native (${{ matrix.os }})
15
- runs-on : ${{ matrix.os }}
14
+ name : sentry-native (${{ matrix.runner.container || matrix.runner.os }})
15
+ runs-on : ${{ matrix.runner.os }}
16
+ container : ${{ matrix.runner.container }}
16
17
strategy :
17
18
fail-fast : false
18
19
matrix :
19
20
# Pin ubuntu to ensure mono is installed
20
21
# 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]
22
+ runner : [
23
+ {os: ubuntu-22.04},
24
+ {os: ubuntu-latest, container: alpine:3.21},
25
+ {os: windows-latest},
26
+ {os: macos-15}
27
+ ]
22
28
23
29
steps :
30
+ - name : Install build dependencies for Alpine Linux
31
+ if : ${{ startsWith(matrix.runner.container, 'alpine') }}
32
+ run : |
33
+ apk update
34
+ apk add bash build-base cmake curl-dev git powershell sudo tar wget
35
+ git config --global --add safe.directory $GITHUB_WORKSPACE
36
+
24
37
- name : Checkout
25
38
uses : actions/checkout@v4
26
39
@@ -30,14 +43,15 @@ jobs:
30
43
id : cache
31
44
with :
32
45
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') }}
46
+ key : sentry-native-${{ matrix.runner.container || runner.os }}-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
34
47
enableCrossOsArchive : true
35
48
36
49
- name : Remove unused applications
50
+ if : ${{ !matrix.runner.container }}
37
51
uses : ./.github/actions/freediskspace
38
52
39
53
- name : Install build dependencies
40
- if : steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
54
+ if : steps.cache.outputs.cache-hit != 'true' && runner.os == 'Linux' && !matrix.runner.container
41
55
run : |
42
56
sudo apt update
43
57
sudo apt install libcurl4-openssl-dev
@@ -48,28 +62,44 @@ jobs:
48
62
49
63
build :
50
64
needs : build-sentry-native
51
- name : .NET (${{ matrix.os }})
52
- runs-on : ${{ matrix.os }}
65
+ name : .NET (${{ matrix.runner.container || matrix.runner.os }})
66
+ runs-on : ${{ matrix.runner.os }}
67
+ container : ${{ matrix.runner.container }}
53
68
54
69
strategy :
55
70
fail-fast : false
56
71
matrix :
57
72
# Pin ubuntu to ensure mono is installed
58
73
# 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]
74
+ runner : [
75
+ {os: ubuntu-22.04},
76
+ {os: ubuntu-latest, container: alpine:3.21},
77
+ {os: windows-latest},
78
+ {os: macos-15}
79
+ ]
60
80
61
81
steps :
62
82
- name : Cancel Previous Runs
63
83
if : github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')
64
84
uses : styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # Tag: 0.12.1
65
85
86
+ - name : Install build dependencies for Alpine Linux
87
+ if : ${{ startsWith(matrix.runner.container, 'alpine') }}
88
+ run : |
89
+ apk update
90
+ apk add bash build-base cmake curl-dev git openjdk11 openjdk17 powershell sudo tar wget
91
+ git config --global --add safe.directory $GITHUB_WORKSPACE
92
+ curl -sSL --retry 5 https://dot.net/v1/dotnet-install.sh | bash -eo pipefail /dev/stdin --channel 9.0 --install-dir /usr/share/dotnet
93
+ ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet
94
+
66
95
- name : Checkout
67
96
uses : actions/checkout@v4
68
97
with :
69
98
submodules : recursive
70
99
fetch-depth : 2 # default is 1 and codecov needs > 1
71
100
72
101
- name : Remove unused applications
102
+ if : ${{ !matrix.runner.container }}
73
103
uses : ./.github/actions/freediskspace
74
104
75
105
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages
@@ -85,6 +115,14 @@ jobs:
85
115
key : sentry-native-Linux-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
86
116
fail-on-cache-miss : true
87
117
118
+ - name : Download sentry-native (Linux musl)
119
+ if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (startsWith(matrix.runner.container, 'alpine')) }}
120
+ uses : actions/cache/restore@v4
121
+ with :
122
+ path : src/Sentry/Platforms/Native/sentry-native
123
+ key : sentry-native-alpine:3.21-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
124
+ fail-on-cache-miss : true
125
+
88
126
- name : Download sentry-native (macOS)
89
127
if : ${{ (env.CI_PUBLISHING_BUILD == 'true') || (runner.os == 'macOS') }}
90
128
uses : actions/cache/restore@v4
@@ -106,6 +144,7 @@ jobs:
106
144
uses : ./.github/actions/environment
107
145
108
146
- name : Build Native Dependencies
147
+ if : ${{ ! matrix.runner.container }}
109
148
uses : ./.github/actions/buildnative
110
149
111
150
- name : Restore .NET Dependencies
0 commit comments