-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
bitrise.yml
265 lines (260 loc) · 7.72 KB
/
bitrise.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
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
trigger_map:
- push_branch: master
workflow: ci
- push_branch: develop
workflow: ci
- pull_request_source_branch: "*"
pull_request_target_branch: develop
workflow: ci
- pull_request_source_branch: "*"
workflow: ci
pull_request_target_branch: master
workflows:
ci:
after_run:
- run_from_repo
run_from_repo:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: continue from repo
inputs:
- content: |-
#!/bin/bash
set -ex
git remote rm fork || true
bitrise run ${BITRISE_APP_TITLE}-${BITRISE_TRIGGERED_WORKFLOW_ID}
iutest-ci:
after_run:
- Mac
- iOS
iutest-mac-ci:
after_run:
- Mac
iutest-ios-ci:
after_run:
- iOS
iutest-android-ci:
after_run:
- Android
Mac:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: Set CACHE env var
inputs:
- content: |
#!/bin/bash
set -ev
envman add --key GEM_HOME --value "$(gem environment gemdir)"
envman add --key BREW_CMAKE --value "$(brew --cellar)/cmake"
envman add --key BREW_OPT_CMAKE --value "/usr/local/opt/cmake"
#envman add --key BREW_CACHE_CMAKE --value "$(brew --cache)/cmake"
- cache-pull: {}
- script:
title: gem install
inputs:
- content: |-
system_profiler SPHardwareDataType
gem install xcpretty
- script:
title: CMake
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -ex
cmake --version
mkdir xcode
cd xcode
cmake ../projects/cmake -G "Xcode" -DCMAKE_XCODE_GENERATE_SCHEME=TRUE \
-Dbuild_use_gtest_configuration=OFF
- script:
title: Xcodebuild
inputs:
- content: |-
#!/bin/bash
set -euo pipefail
xcodebuild -project xcode/iutest.xcodeproj -list
#xcodebuild -project xcode/iutest.xcodeproj -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=2 build | xcpretty -c
xcodebuild -project xcode/iutest.xcodeproj build | xcpretty -c
- script:
title: Tests
inputs:
- content: |-
#!/bin/bash
set -euo pipefail
#xcodebuild -project xcode/iutest.xcodeproj -scheme all_tests test
#xcodebuild -project xcode/iutest.xcodeproj -scheme all_tests -destination 'platform=iOS' test
cd xcode
ctest -C Debug -V
- cache-push:
inputs:
- cache_paths: |
$BITRISE_CACHE_DIR
$GEM_HOME
$BREW_CMAKE
$BREW_OPT_CMAKE
meta:
bitrise.io:
stack: osx-xcode-13.4.x
iOS:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: Set CACHE env var
inputs:
- content: |
#!/bin/bash
set -ev
envman add --key GEM_HOME --value "$(gem environment gemdir)"
envman add --key BREW_CMAKE --value "$(brew --cellar)/cmake"
envman add --key BREW_OPT_CMAKE --value "/usr/local/opt/cmake"
#envman add --key BREW_CACHE_CMAKE --value "$(brew --cache)/cmake"
- cache-pull: {}
- script:
title: gem install
inputs:
- content: |-
system_profiler SPHardwareDataType
gem install xcpretty
- script:
title: Clone iOS CMake toolchain
inputs:
- content: |-
#!/bin/bash
git clone https://github.com/leetal/ios-cmake.git
- script:
title: CMake
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -ex
cmake --version
mkdir ios
cd ios
cmake ../projects/cmake -G "Xcode" -DCMAKE_XCODE_GENERATE_SCHEME=TRUE \
-Dbuild_use_gtest_configuration=OFF \
-DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED
- script:
title: Xcodebuild
inputs:
- content: |-
#!/bin/bash
set -euo pipefail
xcodebuild -project ios/iutest.xcodeproj -list
#xcodebuild -project ios/iutest.xcodeproj -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=2 build | xcpretty -c
xcodebuild -project ios/iutest.xcodeproj build | xcpretty -c
- script:
title: Tests
inputs:
- content: |-
#!/bin/bash
set -euo pipefail
#xcodebuild -project ios/iutest.xcodeproj -scheme all_tests test
#xcodebuild -project ios/iutest.xcodeproj -scheme all_tests -destination 'platform=iOS' test
cd ios
# ctest -C Debug -V
- cache-push:
inputs:
- cache_paths: |
$BITRISE_CACHE_DIR
$GEM_HOME
$BREW_CMAKE
$BREW_OPT_CMAKE
meta:
bitrise.io:
stack: osx-xcode-13.4.x
Android:
steps:
- script:
inputs:
- content: cat /etc/lsb-release || sw_vers || true
title: Check Stack
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: Set cache directory
inputs:
- content: |-
eval $(apt-config shell CACHE Dir::Cache)
eval $(apt-config shell ARCHIVES Dir::Cache::archives)
echo /${CACHE}${ARCHIVES}
envman add --key APT_CACHE_DIR --value $CACHE
- cache-pull: {}
- script:
title: SetUp Environments
inputs:
- content: |
#!/usr/bin/env bash
set -ex
env
envman add --key ANDROID_NDK_ROOT --value ${ANDROID_NDK_HOME}
- script:
title: CMake
inputs:
- content: |-
#!/bin/bash
set -ex
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 90
python --version
sudo python get-pip.py --force-reinstall
# python -m pip install --upgrade pip==20.0
python -m pip install --upgrade pip
python -m pip install --upgrade cmake
cmake --version
mkdir android-build
cd android-build
cmake ../projects/cmake -Dbuild_use_gtest_configuration=OFF \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_NATIVE_API_LEVEL=24 \
-DANDROID_STL=c++_static \
-DCMAKE_FIND_DEBUG_MODE=1
- script:
title: Build
inputs:
- content: |
#!/bin/bash
set -ex
cmake --build ./android-build
- cache-push:
inputs:
- cache_paths: |
$BITRISE_CACHE_DIR
$APT_CACHE_DIR
meta:
bitrise.io:
stack: linux-docker-android-20.04
primary:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- script:
title: continue from repo
inputs:
- content: |-
#!/bin/bash
set -ex
git remote rm fork || true
bitrise run iOS
bitrise run Android
test:
after_run:
- Mac
- iOS
- Android