@@ -21,12 +21,15 @@ workflows:
2121 before_run :
2222 - tests
2323 - _test_builds
24+ - _push_cache
2425 deploy-to-staging :
2526 after_run :
2627 before_run :
27- - primary
28+ - tests
29+ - _test_builds
2830 - _semantic_release
2931 - _make_apk
32+ - _push_cache
3033 - _deploy_to_beta_testers
3134 _init_install :
3235 description : Do initial setup
@@ -51,6 +54,7 @@ workflows:
5154 else
5255 envman add --key PROCEED_WITH_DEPLOYMENT --value 1
5356 fi
57+ - cache-pull@2.0.1 : {}
5458 - script@1.1.5 :
5559 title : Install Detox Utils
5660 inputs :
@@ -69,7 +73,6 @@ workflows:
6973 title : Install npm-cache
7074 inputs :
7175 - command : install -g npm-cache
72- - cache-pull@2.0.1 : {}
7376 - script@1.1.5 :
7477 title : npm-cache install
7578 inputs :
@@ -82,7 +85,7 @@ workflows:
8285 # debug log
8386 set -x
8487
85- npm-cache install --cacheDirectory .
88+ npm-cache install --cacheDirectory . npm
8689 - install-react-native@0.9.1 : {}
8790 - npm@0.9.0 :
8891 title : Install Semantic Release
@@ -92,10 +95,11 @@ workflows:
9295 title : Install Detox CLI
9396 inputs :
9497 - command : install -g detox-cli
95- - install-missing-android-tools@2.0.6 : {}
96- - cache-push@2.0.3 :
98+ - npm@0.9.0 :
99+ title : Install Codecov
97100 inputs :
98- - cache_paths : " ./npm"
101+ - command : install -g codecov
102+ - install-missing-android-tools@2.1.0 : {}
99103 _unit_tests :
100104 description : Run all unit tests
101105 steps :
@@ -112,7 +116,38 @@ workflows:
112116 set -x
113117
114118 npm run validate
119+
120+ codecov
115121 is_always_run : true
122+ _integration_and_e2e_debug_tests :
123+ description : Run all Integration and E2E Debug App Tests using Detox
124+ steps :
125+ - script@1.1.5 :
126+ title : Detox - Build Android Debug App
127+ inputs :
128+ - content : |-
129+ #!/usr/bin/env bash
130+
131+ # fail if any commands fails
132+ set -e
133+
134+ # debug log
135+ set -x
136+
137+ detox build --configuration android.emu.debug
138+ - script@1.1.5 :
139+ title : Detox - Run Android E2E Debug Tests
140+ inputs :
141+ - content : |-
142+ #!/usr/bin/env bash
143+
144+ # fail if any commands fails
145+ set -e
146+
147+ # debug log
148+ set -x
149+
150+ detox test --configuration android.emu.debug --cleanup
116151 _tests_slack_message :
117152 steps :
118153 - slack@2.6.3 :
@@ -126,7 +161,7 @@ workflows:
126161 - message_on_error : " *Build Number*: $BITRISE_BUILD_NUMBER\n *Build Status*:
127162 Failed \n *Commit*: $BITRISE_GIT_MESSAGE\n *Branch*: $BITRISE_GIT_BRANCH"
128163 - image_url : https://media.giphy.com/media/geslvCFM31sFW/giphy.gif
129- - image_url_on_error : https://media.giphy.com/media/1BXa2alBjrCXC /giphy.gif
164+ - image_url_on_error : https://media.giphy.com/media/BEob5qwFkSJ7G /giphy.gif
130165 - webhook_url : " $SLACK_WEBHOOK_URL"
131166 _semantic_release :
132167 steps :
@@ -142,23 +177,17 @@ workflows:
142177 # debug log
143178 set -x
144179
180+ envman add --key CURRENT_RELEASE_VERSION --value $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g')
181+
182+ git checkout develop
183+ # we'll enable the following 2 lines if we encounter any problems
184+ # git fetch
185+ # git pull
186+
145187 semantic-release
146188
147189 envman add --key NEW_RELEASE_VERSION --value $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g')
148190 title : Run Semantic Release
149- - slack@2.6.3 :
150- title : Slack - Send Release Status
151- inputs :
152- - channel : " #bitrise-releases"
153- - from_username_on_error : Bitrise CI - Failed to Make an Android Release!
154- - from_username : Bitrise CI - We Have a New Android Release
155- - message : " *Build Number*: $BITRISE_BUILD_NUMBER\n *Build Status*: Succeeded
156- \n *Commit*: $BITRISE_GIT_MESSAGE\n *Branch*: $BITRISE_GIT_BRANCH"
157- - message_on_error : " *Build Number*: $BITRISE_BUILD_NUMBER\n *Build Status*:
158- Failed \n *Commit*: $BITRISE_GIT_MESSAGE\n *Branch*: $BITRISE_GIT_BRANCH"
159- - image_url_on_error : https://media.giphy.com/media/ZanWL0MNtv3y0/giphy.gif
160- - image_url : https://media.giphy.com/media/s2qXK8wAvkHTO/giphy.gif
161- - webhook_url : " $SLACK_WEBHOOK_URL"
162191 _make_apk :
163192 steps :
164193 - file-downloader@0.9.1 :
@@ -169,6 +198,10 @@ workflows:
169198 - gradle-runner@1.8.0 :
170199 run_if : ' {{enveq "PROCEED_WITH_DEPLOYMENT" "1"}}'
171200 inputs :
201+ - apk_file_exclude_filter : |
202+ *unaligned.apk
203+ *Test*.apk
204+ *debug.apk
172205 - gradle_task : assembleRelease
173206 - sign-apk@1.2.0 :
174207 run_if : ' {{enveq "PROCEED_WITH_DEPLOYMENT" "1"}}'
@@ -187,6 +220,17 @@ workflows:
187220 title : Test Building Android Debug App
188221 _deploy_to_beta_testers :
189222 steps :
223+ - script@1.1.5 :
224+ title : Remove Unsigned Release APK from Deploy Directory
225+ inputs :
226+ - content : |-
227+ #!/usr/bin/env bash
228+ # fail if any commands fails
229+ set -e
230+ # debug log
231+ set -x
232+
233+ rm /Users/vagrant/deploy/app-release.apk
190234 - deploy-to-bitrise-io@1.3.10 :
191235 is_always_run : false
192236 run_if : ' {{enveq "PROCEED_WITH_DEPLOYMENT" "1"}}'
@@ -199,6 +243,38 @@ workflows:
199243 - auto_update : ' on'
200244 - applivery-android@0.2.1 :
201245 run_if : ' {{enveq "PROCEED_WITH_DEPLOYMENT" "1"}}'
246+ - slack@2.6.3 :
247+ title : Slack - Send Release Status
248+ run_if : ' {{getenv "CURRENT_RELEASE_VERSION" | eq (getenv "NEW_RELEASE_VERSION")
249+ | not}}'
250+ inputs :
251+ - channel : " #bitrise-releases"
252+ - from_username_on_error : Bitrise CI - Failed to Make an Android Release!
253+ - from_username : Bitrise CI - We Have a New Android Release
254+ - message : |-
255+ *Build Number*: $BITRISE_BUILD_NUMBER
256+ *Build Status*: Succeeded
257+ *Release Version*: $NEW_RELEASE_VERSION
258+ *Commit*: $BITRISE_GIT_MESSAGE
259+ *Branch*: $BITRISE_GIT_BRANCH
260+ - message_on_error : " *Build Number*: $BITRISE_BUILD_NUMBER\n *Build Status*:
261+ Failed \n *Commit*: $BITRISE_GIT_MESSAGE\n *Branch*: $BITRISE_GIT_BRANCH"
262+ - image_url_on_error : https://media.giphy.com/media/ZanWL0MNtv3y0/giphy.gif
263+ - image_url : https://media.giphy.com/media/s2qXK8wAvkHTO/giphy.gif
264+ - webhook_url : " $SLACK_WEBHOOK_URL"
265+ _push_cache :
266+ steps :
267+ - cache-push@2.0.3 :
268+ inputs :
269+ - ignore_check_on_paths : |-
270+ $HOME/.gradle/caches/*.lock
271+ $HOME/.gradle/caches/*.bin
272+ ./.gradle/*.lock
273+ ./.gradle/*.bin
274+ - cache_paths : |-
275+ ./npm
276+ $HOME/.gradle
277+ ./.gradle
202278app :
203279 envs :
204280 - opts :
0 commit comments