-
Notifications
You must be signed in to change notification settings - Fork 93
213 lines (187 loc) · 6.98 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]
jobs:
podspec:
name: Lint Podspec for ${{ matrix.platform }}
runs-on: macos-11
strategy:
matrix:
platform: [ios, osx, tvos, watchos]
steps:
- uses: actions/checkout@v3
- name: Lint Podspec
run: pod lib lint --platforms=${{ matrix.platform }}
test_framework:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: "xcodebuild (iOS 15.2, Xcode 13.2.1)"
os: macos-12
xcode-version: "13.2.1"
sdk: iphonesimulator15.2
destination: "platform=iOS Simulator,OS=15.2,name=iPhone 13"
- name: "xcodebuild (macOS 12.1, Xcode 13.2.1)"
os: macos-12
xcode-version: "13.2.1"
sdk: macosx12.1
destination: "platform=OS X"
- name: "xcodebuild (watchOS 8.3, Xcode 13.2.1)"
os: macos-12
xcode-version: "13.2.1"
sdk: watchos8.3
destination: "platform=watchOS Simulator,OS=8.3,name=Apple Watch Series 7 - 45mm"
- name: "xcodebuild (tvOS 15.2, Xcode 13.2.1)"
os: macos-12
xcode-version: "13.2.1"
sdk: appletvsimulator15.2
destination: "platform=tvOS Simulator,OS=15.2,name=Apple TV"
steps:
- name: Checkout
uses: actions/checkout@v3
# -- Micro --
- name: Cache Micro
id: cache-micro
uses: actions/cache@v3
with:
path: micro.jar
key: ${{ runner.os }}-micro
- name: Get micro
if: steps.cache-micro.outputs.cache-hit != 'true'
run: curl -o micro.jar -L https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.7.0/snowplow-micro-1.7.0.jar
- name: Run Micro in background
run: java -jar micro.jar &
- name: Wait on Micro endpoint
timeout-minutes: 2
run: while ! nc -z '0.0.0.0' 9090; do sleep 1; done
# -- Micro --
- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
- name: Build & Test
run: |
set -o pipefail && xcodebuild \
-scheme SnowplowTracker \
-sdk "${{ matrix.sdk }}" \
-destination "${{ matrix.destination }}" \
-only-testing:Tests/Integration/ \
clean test | xcpretty
build_objc_demo_app:
name: "ObjC demo (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {ios: 15.5, iphone: iPhone 12 Pro, watchos: 8.5, watch: Apple Watch Series 5 - 44mm, macos: '12', xcode: 13.4}
- {ios: 14.4, iphone: iPhone 8, watchos: 7.2, watch: Apple Watch Series 4 - 40mm, macos: '11', xcode: 12.4}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowObjCDemo -podfile Podfile -ios "${BUILD_WORKSPACE_OBJC_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_OBJC_DEMO}"
build_swift_cocoapods_demo_app:
name: "Swift demo (Cocoapods) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {ios: '14.4', iphone: iPhone 12 Pro, watchos: '7.2', watch: Apple Watch Series 5 - 44mm, macos: '11', xcode: 12.4}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowSwiftCocoapodsDemo -podfile Podfile -ios "${BUILD_WORKSPACE_SWIFT_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_DEMO_IOS}" -watch "${BUILD_DEST_PAIRED}" "${BUILD_SCHEME_SWIFT_DEMO_WATCH}"
build_swift_spm_demo_app:
name: "Swift demo (SPM) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {ios: '14.4', iphone: iPhone 11 Pro, watchos: '7.2', watch: Apple Watch Series 5 - 44mm, macos: '11', xcode: 12.4}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Get branch name
id: branch
run: |
# Set git branch or git tag as slug
if [[ ${GITHUB_REF} =~ ^refs\/tags\/ ]]; then
GIT_BRANCH=master
else
if [ -n "${GITHUB_HEAD_REF}" ]; then
GIT_BRANCH="${GITHUB_HEAD_REF}"
else
GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
fi
fi
echo ::set-output name=name::${GIT_BRANCH}
- name: Build
env:
IOS: ${{ matrix.version.ios }}
WATCHOS: ${{ matrix.version.watchos }}
IPHONE: ${{ matrix.version.iphone }}
WATCH: ${{ matrix.version.watch }}
BRANCH: ${{ steps.branch.outputs.name }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app SnowplowSwiftSPMDemo -spm ${BRANCH} -ios "${BUILD_WORKSPACE_SWIFT_SPM_DEMO}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_SWIFT_SPM_DEMO_IOS}"
build_iglu_central_app:
name: "Iglu Central (SPM) (iOS ${{ matrix.version.ios }})"
needs: test_framework
runs-on: macos-${{ matrix.version.macos }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
version:
- {ios: 15.5, iphone: iPhone 12 Pro, macos: '12', xcode: 13.4}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Build
env:
IOS: ${{ matrix.version.ios }}
IPHONE: ${{ matrix.version.iphone }}
BRANCH: ${{ steps.branch.outputs.name }}
run: |
cd Examples/demo/
. .scripts/setup.sh
.scripts/test_ios_demo.sh -app IgluCentral -ios "${BUILD_WORKSPACE_IGLU_CENTRAL}" "${BUILD_DEST_IOS}" "${BUILD_SCHEME_IGLU_CENTRAL_IOS}"