1 |
--- |
2 |
format_version: '11' |
3 |
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git |
4 |
project_type: other |
5 |
trigger_map: |
6 |
- push_branch: master |
7 |
workflow: ci |
8 |
- push_branch: develop |
9 |
workflow: ci |
10 |
- pull_request_source_branch: "*" |
11 |
pull_request_target_branch: develop |
12 |
workflow: ci |
13 |
- pull_request_source_branch: "*" |
14 |
workflow: ci |
15 |
pull_request_target_branch: master |
16 |
workflows: |
17 |
ci: |
18 |
after_run: |
19 |
- run_from_repo |
20 |
run_from_repo: |
21 |
steps: |
22 |
- activate-ssh-key: |
23 |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' |
24 |
- git-clone: {} |
25 |
- script: |
26 |
title: continue from repo |
27 |
inputs: |
28 |
- content: |- |
29 |
#!/bin/bash |
30 |
set -ex |
31 |
git remote rm fork || true |
32 |
bitrise run ${BITRISE_APP_TITLE}-${BITRISE_TRIGGERED_WORKFLOW_ID} |
33 |
iutest-ci: |
34 |
after_run: |
35 |
- Mac |
36 |
- iOS |
37 |
iutest-mac-ci: |
38 |
after_run: |
39 |
- Mac |
40 |
iutest-ios-ci: |
41 |
after_run: |
42 |
- iOS |
43 |
iutest-android-ci: |
44 |
after_run: |
45 |
- Android |
46 |
|
47 |
Mac: |
48 |
steps: |
49 |
- activate-ssh-key: |
50 |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' |
51 |
- git-clone: {} |
52 |
- script: |
53 |
title: Set CACHE env var |
54 |
inputs: |
55 |
- content: | |
56 |
#!/bin/bash |
57 |
set -ev |
58 |
envman add --key GEM_HOME --value "$(gem environment gemdir)" |
59 |
envman add --key BREW_CMAKE --value "$(brew --cellar)/cmake" |
60 |
envman add --key BREW_OPT_CMAKE --value "/usr/local/opt/cmake" |
61 |
#envman add --key BREW_CACHE_CMAKE --value "$(brew --cache)/cmake" |
62 |
- cache-pull: {} |
63 |
- script: |
64 |
title: gem install |
65 |
inputs: |
66 |
- content: |- |
67 |
system_profiler SPHardwareDataType |
68 |
gem install xcpretty |
69 |
- script: |
70 |
title: CMake |
71 |
inputs: |
72 |
- content: |- |
73 |
#!/bin/bash |
74 |
# fail if any commands fails |
75 |
set -ex |
76 |
cmake --version |
77 |
mkdir xcode |
78 |
cd xcode |
79 |
cmake ../projects/cmake -G "Xcode" -DCMAKE_XCODE_GENERATE_SCHEME=TRUE \ |
80 |
-Dbuild_use_gtest_configuration=OFF |
81 |
- script: |
82 |
title: Xcodebuild |
83 |
inputs: |
84 |
- content: |- |
85 |
#!/bin/bash |
86 |
set -euo pipefail |
87 |
xcodebuild -project xcode/iutest.xcodeproj -list |
88 |
#xcodebuild -project xcode/iutest.xcodeproj -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=2 build | xcpretty -c |
89 |
xcodebuild -project xcode/iutest.xcodeproj build | xcpretty -c |
90 |
- script: |
91 |
title: Tests |
92 |
inputs: |
93 |
- content: |- |
94 |
#!/bin/bash |
95 |
set -euo pipefail |
96 |
#xcodebuild -project xcode/iutest.xcodeproj -scheme all_tests test |
97 |
#xcodebuild -project xcode/iutest.xcodeproj -scheme all_tests -destination 'platform=iOS' test |
98 |
cd xcode |
99 |
ctest -C Debug -V |
100 |
- cache-push: |
101 |
inputs: |
102 |
- cache_paths: | |
103 |
$BITRISE_CACHE_DIR |
104 |
$GEM_HOME |
105 |
$BREW_CMAKE |
106 |
$BREW_OPT_CMAKE |
107 |
meta: |
108 |
bitrise.io: |
109 |
stack: osx-xcode-13.4.x |
110 |
|
111 |
iOS: |
112 |
steps: |
113 |
- activate-ssh-key: |
114 |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' |
115 |
- git-clone: {} |
116 |
- script: |
117 |
title: Set CACHE env var |
118 |
inputs: |
119 |
- content: | |
120 |
#!/bin/bash |
121 |
set -ev |
122 |
envman add --key GEM_HOME --value "$(gem environment gemdir)" |
123 |
envman add --key BREW_CMAKE --value "$(brew --cellar)/cmake" |
124 |
envman add --key BREW_OPT_CMAKE --value "/usr/local/opt/cmake" |
125 |
#envman add --key BREW_CACHE_CMAKE --value "$(brew --cache)/cmake" |
126 |
- cache-pull: {} |
127 |
- script: |
128 |
title: gem install |
129 |
inputs: |
130 |
- content: |- |
131 |
system_profiler SPHardwareDataType |
132 |
gem install xcpretty |
133 |
- script: |
134 |
title: Clone iOS CMake toolchain |
135 |
inputs: |
136 |
- content: |- |
137 |
#!/bin/bash |
138 |
git clone https://github.com/leetal/ios-cmake.git |
139 |
- script: |
140 |
title: CMake |
141 |
inputs: |
142 |
- content: |- |
143 |
#!/bin/bash |
144 |
# fail if any commands fails |
145 |
set -ex |
146 |
cmake --version |
147 |
mkdir ios |
148 |
cd ios |
149 |
cmake ../projects/cmake -G "Xcode" -DCMAKE_XCODE_GENERATE_SCHEME=TRUE \ |
150 |
-Dbuild_use_gtest_configuration=OFF \ |
151 |
-DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED |
152 |
- script: |
153 |
title: Xcodebuild |
154 |
inputs: |
155 |
- content: |- |
156 |
#!/bin/bash |
157 |
set -euo pipefail |
158 |
xcodebuild -project ios/iutest.xcodeproj -list |
159 |
#xcodebuild -project ios/iutest.xcodeproj -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=2 build | xcpretty -c |
160 |
xcodebuild -project ios/iutest.xcodeproj build | xcpretty -c |
161 |
- script: |
162 |
title: Tests |
163 |
inputs: |
164 |
- content: |- |
165 |
#!/bin/bash |
166 |
set -euo pipefail |
167 |
#xcodebuild -project ios/iutest.xcodeproj -scheme all_tests test |
168 |
#xcodebuild -project ios/iutest.xcodeproj -scheme all_tests -destination 'platform=iOS' test |
169 |
cd ios |
170 |
# ctest -C Debug -V |
171 |
- cache-push: |
172 |
inputs: |
173 |
- cache_paths: | |
174 |
$BITRISE_CACHE_DIR |
175 |
$GEM_HOME |
176 |
$BREW_CMAKE |
177 |
$BREW_OPT_CMAKE |
178 |
meta: |
179 |
bitrise.io: |
180 |
stack: osx-xcode-13.4.x |
181 |
|
182 |
Android: |
183 |
steps: |
184 |
- script: |
185 |
inputs: |
186 |
- content: cat /etc/lsb-release || sw_vers || true |
187 |
title: Check Stack |
188 |
- activate-ssh-key: |
189 |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' |
190 |
- git-clone: {} |
191 |
- script: |
192 |
title: Set cache directory |
193 |
inputs: |
194 |
- content: |- |
195 |
eval $(apt-config shell CACHE Dir::Cache) |
196 |
eval $(apt-config shell ARCHIVES Dir::Cache::archives) |
197 |
echo /${CACHE}${ARCHIVES} |
198 |
envman add --key APT_CACHE_DIR --value $CACHE |
199 |
- cache-pull: {} |
200 |
- script: |
201 |
title: SetUp Environments |
202 |
inputs: |
203 |
- content: | |
204 |
#!/usr/bin/env bash |
205 |
set -ex |
206 |
env |
207 |
envman add --key ANDROID_NDK_ROOT --value ${ANDROID_NDK_HOME} |
208 |
- script: |
209 |
title: CMake |
210 |
inputs: |
211 |
- content: |- |
212 |
#!/bin/bash |
213 |
set -ex |
214 |
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
215 |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 90 |
216 |
python --version |
217 |
sudo python get-pip.py --force-reinstall |
218 |
# python -m pip install --upgrade pip==20.0 |
219 |
python -m pip install --upgrade pip |
220 |
python -m pip install --upgrade cmake |
221 |
cmake --version |
222 |
mkdir android-build |
223 |
cd android-build |
224 |
cmake ../projects/cmake -Dbuild_use_gtest_configuration=OFF \ |
225 |
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \ |
226 |
-DANDROID_ABI=arm64-v8a \ |
227 |
-DANDROID_NATIVE_API_LEVEL=24 \ |
228 |
-DANDROID_STL=c++_static \ |
229 |
-DCMAKE_FIND_DEBUG_MODE=1 |
230 |
- script: |
231 |
title: Build |
232 |
inputs: |
233 |
- content: | |
234 |
#!/bin/bash |
235 |
set -ex |
236 |
cmake --build ./android-build |
237 |
- cache-push: |
238 |
inputs: |
239 |
- cache_paths: | |
240 |
$BITRISE_CACHE_DIR |
241 |
$APT_CACHE_DIR |
242 |
meta: |
243 |
bitrise.io: |
244 |
stack: linux-docker-android-20.04 |
245 |
|
246 |
primary: |
247 |
steps: |
248 |
- activate-ssh-key: |
249 |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' |
250 |
- git-clone: {} |
251 |
- script: |
252 |
title: continue from repo |
253 |
inputs: |
254 |
- content: |- |
255 |
#!/bin/bash |
256 |
set -ex |
257 |
git remote rm fork || true |
258 |
bitrise run iOS |
259 |
bitrise run Android |
260 |
|
261 |
test: |
262 |
after_run: |
263 |
- Mac |
264 |
- iOS |
265 |
- Android |