-
-
Notifications
You must be signed in to change notification settings - Fork 323
213 lines (194 loc) · 6.95 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Build
on:
push:
branches:
- main
- release/**
pull_request:
paths:
- 'Sources/**'
- 'test-server/**'
- 'Samples/**'
- '.github/workflows/build.yml'
- 'fastlane/**'
- 'scripts/ci-select-xcode.sh'
- Sentry.xcworkspace
- Sentry.xcodeproj
- Gemfile.lock
- 'Package.swift'
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# We had issues that the release build was broken on main.
# With this we catch potential issues already in the PR.
ios-swift-release:
name: Release Build of iOS Swift
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Fastlane
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
run: bundle exec fastlane build_ios_swift
shell: sh
build-sample:
name: Sample ${{ matrix.scheme }}
runs-on: macos-13
strategy:
fail-fast: false
matrix:
# other sample projects are built in ui-tests
scheme:
- macOS-Swift
- iOS13-Swift
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh
# Disable code signing. We just want to make sure these compile.
- run: >-
env NSUnbufferedIO=YES
xcodebuild
-workspace Sentry.xcworkspace
-scheme '${{matrix.scheme}}'
-configuration Debug
CODE_SIGNING_ALLOWED="NO"
build
build-watch-os-sample:
name: Sample watchOS
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 13.4.1
- run: make build-for-watchos
# Disable code signing. We just want to make sure these compile.
- run: >-
env NSUnbufferedIO=YES
xcodebuild
-project Samples/watchOS-Swift/watchOS-Swift.xcodeproj
-configuration Debug
CODE_SIGNING_ALLOWED="NO"
build
build-xcframework:
name: Build XCFramework
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: ./scripts/ci-select-xcode.sh 15.0.1
- run: make build-xcframework
shell: sh
- name: Archiving XCFramework.zip
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
if-no-files-found: error
path: |
${{ github.workspace }}/*.zip
- name: Archive build log if failed
uses: actions/upload-artifact@v4
if: ${{ failure() || cancelled() }}
with:
name: raw-build-output-build-xcframework
path: |
build-xcframework.log
validate-xcframework:
name: Validate XCFramework
runs-on: macos-13
needs: build-xcframework
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- run: ./scripts/ci-select-xcode.sh 15.0.1
- run: make build-xcframework-sample
shell: sh
# Use github.event.pull_request.head.sha instead of github.sha when available as
# the github.sha is be the pre merge commit id for PRs.
# See https://github.community/t/github-sha-isnt-the-value-expected/17903/17906.
validate-spm:
name: Validate Swift Package Manager
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Set SPM revision to current git commit
run: >-
if [[ "${{ github.event.pull_request.head.sha }}" != "" ]]; then
sed -i '' 's/.branch("main")/.revision("${{ github.event.pull_request.head.sha }}")/g' Samples/macOS-SPM-CommandLine/Package.swift
else
sed -i '' 's/.branch("main")/.revision("${{ github.sha }}")/g' Samples/macOS-SPM-CommandLine/Package.swift
fi
shell: bash
- run: swift build
working-directory: Samples/macOS-SPM-CommandLine
shell: sh
validate-spm-dynamic:
name: Validate Swift Package Manager Dynamic
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Set SPM revision to current git commit
run: >-
if [[ "${{ github.event.pull_request.head.sha }}" != "" ]]; then
sed -i '' 's/.branch("main")/.revision("${{ github.event.pull_request.head.sha }}")/g' Samples/SPM-Dynamic/Package.swift
else
sed -i '' 's/.branch("main")/.revision("${{ github.sha }}")/g' Samples/SPM-Dynamic/Package.swift
fi
shell: bash
- run: swift build
working-directory: Samples/SPM-Dynamic
shell: sh
swift-build:
name: Build with Swift
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: swift build
shell: sh
check-uikit-linkage-debug-UIKitless:
name: Check no UIKit linkage (Debug_without_UIKit)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Debug
run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug_without_UIKit uikit-check-build
- name: Ensure no UIKit
run: ./scripts/check-uikit-linkage.sh Debug_without_UIKit uikit-check-build unlinked
check-uikit-linkage-release-UIKitless:
name: Check no UIKit linkage (Release_without_UIKit)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Release
run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release_without_UIKit uikit-check-build
- name: Ensure no UIKit
run: ./scripts/check-uikit-linkage.sh Release_without_UIKit uikit-check-build unlinked
check-uikit-linkage-debug:
name: Check UIKit linkage (Debug)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Debug
run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug uikit-check-build
- name: Ensure no UIKit
run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked
check-uikit-linkage-release:
name: Check UIKit linkage (Release)
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build for Release
run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release uikit-check-build
- name: Ensure no UIKit
run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked