-
-
Notifications
You must be signed in to change notification settings - Fork 875
293 lines (293 loc) · 11.6 KB
/
ci.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
---
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- "**"
env:
CI_XCODE_15: /Applications/Xcode_15.4.0.app/Contents/Developer
CI_XCODE_16: /Applications/Xcode_16.1.0.app/Contents/Developer
jobs:
# tests:
# env:
# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# timeout-minutes: 45
# strategy:
# matrix:
# script:
# - test:ios
# - test:macos
# - test:parse_live_query:all
# - xcode15 # runs build:starters on Xcode 15
# - xcode16 # runs build:starters on Xcode 16
# fail-fast: false
# runs-on: macos-14
# steps:
# - uses: actions/checkout@v4
# - name: Cache SPM
# uses: actions/cache@v4
# with:
# path: ~/Library/Developer/Xcode/DerivedData/Parse*/SourcePackages/
# key: ${{ runner.os }}-spm-${{ hashFiles('Parse.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
# restore-keys: |
# ${{ runner.os }}-spm-
# - name: Setup Ruby
# uses: ruby/setup-ruby@v1
# with:
# bundler-cache: true
# - name: Create and set the default keychain
# run: |
# security create-keychain -p "" temporary
# security default-keychain -s temporary
# security unlock-keychain -p "" temporary
# security set-keychain-settings -lut 7200 temporary
# - name: Submodules
# run: git submodule update --init --recursive
# - name: Build-Test
# run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake ${{ ((matrix.script == 'xcode15' || matrix.script == 'xcode16') && 'build:starters') || matrix.script }}
# env:
# DEVELOPER_DIR: ${{ (matrix.script == 'xcode15' && env.CI_XCODE_15) || env.CI_XCODE_16 }}
# - name: Generate Environment Variables
# if: ${{ always() }}
# env:
# ARTIFACT_NAME: ${{ matrix.script }}-logs
# TEST_RESULTS: ${{ matrix.script }}.xcresult
# run: |
# ARTIFACT_NAME=${{ env.ARTIFACT_NAME }}
# TEST_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcresult")
# BUILD_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcactivitylog")
# echo ARTIFACT_NAME=${ARTIFACT_NAME//:/-} >> $GITHUB_ENV # replace colon with dashes
# echo TEST_RESULTS=${TEST_RESULTS} >> $GITHUB_ENV
# echo "Artifact Name: $ARTIFACT_NAME"
# echo "Test Result Location: $TEST_RESULTS"
# echo "Build Result Location: $BUILD_RESULTS"
# - name: Upload Artifact Logs
# if: ${{ failure() }}
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.ARTIFACT_NAME }}
# path: |
# ~/Library/Developer/Xcode/DerivedData/Parse-*/Logs/Test
# ~/Library/Developer/Xcode/DerivedData/**/Logs/Build
# - name: Install test parsing dependencies
# if: matrix.script == 'test:ios'
# # Workaround as codecov cannot parse xcresult files;
# # https://github.com/codecov/uploader/issues/1078
# # https://github.com/codecov/codecov-action/issues/1367
# run: |
# brew install a7ex/homebrew-formulae/xcresultparser
# - name: Convert Xcode test results for code coverage upload
# if: matrix.script == 'test:ios'
# env:
# COVERAGE_PATH: ${{ github.workspace }}/build/${{ matrix.script }}-coverage.xml
# run: |
# COVERAGE_PATH=${COVERAGE_PATH//:/-}
# echo COVERAGE_PATH=$COVERAGE_PATH >> $GITHUB_ENV
# echo "TEST_RESULTS: $TEST_RESULTS"
# echo "COVERAGE_PATH: $COVERAGE_PATH"
# set -o pipefail && \
# xcresultparser --output-format cobertura \
# "$TEST_RESULTS" >"$COVERAGE_PATH"
# - name: Upload code coverage
# if: matrix.script == 'test:ios'
# uses: codecov/codecov-action@v4
# with:
# # Set to `true` once codecov token bug is fixed; https://github.com/parse-community/parse-server/issues/9129
# fail_ci_if_error: false
# token: ${{ secrets.CODECOV_TOKEN }}
# plugin: xcode
# file: ${{ env.COVERAGE_PATH }}
test-xcode:
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 45
strategy:
matrix:
include:
# Xcode
- name: Xcode 15
script: build:starters
iosVersion: '18.1'
iosDeviceModel: iPhone 16
watchOsVersion: '11.1'
watchDeviceModel: Apple Watch Series 10 (46mm)
tvOsVersion: '18.1'
tvDeviceModel: Apple TV
macosVersion: 14
developerDir: CI_XCODE_15
- name: Xcode 16
script: build:starters
iosVersion: '18.1'
iosDeviceModel: iPhone 16
watchOsVersion: '11.1'
watchDeviceModel: Apple Watch Series 10 (46mm)
tvOsVersion: '18.1'
tvDeviceModel: Apple TV
macosVersion: 14
developerDir: CI_XCODE_16
# Core Module
- name: Core Module, iOS 17
script: test:ios
iosVersion: '17.5'
iosDeviceModel: iPhone 15
macosVersion: 15
developerDir: CI_XCODE_16
- name: Core Module, iOS 18
script: test:ios
iosVersion: '18.1'
iosDeviceModel: iPhone 16
macosVersion: 15
developerDir: CI_XCODE_16
- name: Core Module, macOS 14
script: test:macos
macosVersion: 14
developerDir: CI_XCODE_16
- name: Core Module, macOS 15
script: test:macos
macosVersion: 15
developerDir: CI_XCODE_16
# LiveQuery Module
- name: LiveQuery Module, iOS 17
script: test:parse_live_query:ios
iosVersion: '17.5'
iosDeviceModel: iPhone 15
macosVersion: 15
developerDir: CI_XCODE_16
- name: LiveQuery Module, iOS 18
script: test:parse_live_query:ios
iosVersion: '18.1'
iosDeviceModel: iPhone 16
macosVersion: 15
developerDir: CI_XCODE_16
- name: LiveQuery Module, macOS 14
script: test:parse_live_query:osx
macosVersion: 14
developerDir: CI_XCODE_15
- name: LiveQuery Module, macOS 15
script: test:parse_live_query:osx
macosVersion: 15
developerDir: CI_XCODE_16
- name: LiveQuery Module, watchOS 11
script: test:parse_live_query:watchos
watchOsVersion: '11.1'
watchDeviceModel: Apple Watch Series 10 (46mm)
macosVersion: 15
developerDir: CI_XCODE_16
- name: LiveQuery Module, watchOS 10
script: test:parse_live_query:watchos
watchOsVersion: '10.5'
watchDeviceModel: Apple Watch Series 9 (45mm)
macosVersion: 15
developerDir: CI_XCODE_15
- name: LiveQuery Module, tvOS 17.5
script: test:parse_live_query:tvos
tvOsVersion: '17.5'
tvDeviceModel: Apple TV
macosVersion: 15
developerDir: CI_XCODE_16
- name: LiveQuery Module, tvOS 18.1
script: test:parse_live_query:tvos
tvOsVersion: '18.1'
tvDeviceModel: Apple TV
macosVersion: 15
developerDir: CI_XCODE_16
fail-fast: false
runs-on: macos-${{ matrix.macosVersion || 14 }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: Cache SPM
uses: actions/cache@v4
with:
path: ~/Library/Developer/Xcode/DerivedData/Parse*/SourcePackages/
key: ${{ runner.os }}-spm-${{ hashFiles('Parse.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create and set the default keychain
run: |
security create-keychain -p "" temporary
security default-keychain -s temporary
security unlock-keychain -p "" temporary
security set-keychain-settings -lut 7200 temporary
- name: Submodules
run: git submodule update --init --recursive
- name: Build-Test
run: set -o pipefail && env NSUnbufferedIO=YES IOS_VERSION="${{ matrix.iosVersion }}" IOS_DEVICE_MODEL="${{ matrix.iosDeviceModel }}" WATCH_DEVICE_MODEL="${{ matrix.watchDeviceModel }}" WATCH_OS_VERSION="${{ matrix.watchOsVersion }}" TV_DEVICE_MODEL="${{ matrix.tvDeviceModel }}" TV_OS_VERSION="${{ matrix.tvOsVersion }}" bundle exec rake ${{ matrix.script }}
env:
DEVELOPER_DIR: ${{ env[matrix.developerDir] }}
- name: Generate Environment Variables
if: ${{ always() }}
env:
ARTIFACT_NAME: ${{ matrix.script }}-logs
TEST_RESULTS: ${{ matrix.script }}.xcresult
run: |
ARTIFACT_NAME=${{ env.ARTIFACT_NAME }}
TEST_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcresult")
BUILD_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcactivitylog")
echo ARTIFACT_NAME=${ARTIFACT_NAME//:/-} >> $GITHUB_ENV # replace colon with dashes
echo TEST_RESULTS=${TEST_RESULTS} >> $GITHUB_ENV
echo "Artifact Name: $ARTIFACT_NAME"
echo "Test Result Location: $TEST_RESULTS"
echo "Build Result Location: $BUILD_RESULTS"
- name: Upload Artifact Logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
~/Library/Developer/Xcode/DerivedData/Parse-*/Logs/Test
~/Library/Developer/Xcode/DerivedData/**/Logs/Build
- name: Install test parsing dependencies
if: matrix.script == 'test:ios'
# Workaround as codecov cannot parse xcresult files;
# https://github.com/codecov/uploader/issues/1078
# https://github.com/codecov/codecov-action/issues/1367
run: |
brew install a7ex/homebrew-formulae/xcresultparser
- name: Convert Xcode test results for code coverage upload
if: matrix.script == 'test:ios'
env:
COVERAGE_PATH: ${{ github.workspace }}/build/${{ matrix.script }}-coverage.xml
run: |
COVERAGE_PATH=${COVERAGE_PATH//:/-}
echo COVERAGE_PATH=$COVERAGE_PATH >> $GITHUB_ENV
echo "TEST_RESULTS: $TEST_RESULTS"
echo "COVERAGE_PATH: $COVERAGE_PATH"
set -o pipefail && \
xcresultparser --output-format cobertura \
"$TEST_RESULTS" >"$COVERAGE_PATH"
- name: Upload code coverage
if: matrix.script == 'test:ios'
uses: codecov/codecov-action@v4
with:
# Set to `true` once codecov token bug is fixed; https://github.com/parse-community/parse-server/issues/9129
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
plugin: xcode
file: ${{ env.COVERAGE_PATH }}
docs:
runs-on: macos-14
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Submodules
run: git submodule update --init --recursive
- name: Create Jazzy Docs
run: |
./Scripts/jazzy.sh
env:
DEVELOPER_DIR: ${{ env.CI_XCODE_16 }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true