1- format_version : 5
1+ format_version : 7
22default_step_lib_source : https://github.com/bitrise-io/bitrise-steplib.git
33
44app :
55 envs :
6- - BITRISE_STEP_GIT_CLONE_URL : https://github.com/bitrise-steplib/bitrise-step- android-unit -test.git
7- - MY_STEPLIB_REPO_FORK_GIT_URL : $MY_STEPLIB_REPO_FORK_GIT_URL
8- - SAMPLE_REPO_GIT_CLONE_URL : https://github.com/bitrise-samples/android-multiple-test-results-sample.git
6+ - SAMPLE_REPO_GIT_CLONE_URL : https://github.com/bitrise-io/ android-multiple -test-results-sample .git
7+ - SAMPLE_REPO_KOTLIN_GRADLE_URL : https://github.com/bitrise-io/android-gradle-kotlin-dsl.git
8+ - ORIG_BITRISE_SOURCE_DIR : $BITRISE_SOURCE_DIR
99
1010workflows :
1111 test :
@@ -15,19 +15,23 @@ workflows:
1515 - go-tests
1616 after_run :
1717 - test-in-src-dir
18+ - test-in-src-dir-module-variant
1819 - test-in-root-tmp-dir
19- - check-artifacts
20+ - test-gradle-kts
2021 - check-testaddon-export
2122
2223 test-in-src-dir :
2324 title : Test android project & mono repo projects in source dir
2425 steps :
26+ - change-workdir :
27+ title : cd $ORIG_BITRISE_SOURCE_DIR
28+ inputs :
29+ - path : $ORIG_BITRISE_SOURCE_DIR
2530 - script :
2631 inputs :
27- - content : rm -rf _tmp
32+ - content : rm -rf $ORIG_BITRISE_SOURCE_DIR/ _tmp
2833 - change-workdir :
29- title : cd $BITRISE_SOURCE_DIR/_tmp
30- run_if : true
34+ title : cd $ORIG_BITRISE_SOURCE_DIR/_tmp
3135 inputs :
3236 - path : ./_tmp
3337 - is_create_path : true
@@ -38,12 +42,38 @@ workflows:
3842 inputs :
3943 - gradlew_path : ./gradlew
4044 - path::./ :
41- title : Test simple android project
45+ title : Android Unit Test (monorepo projects in source dir)
46+ after-run :
47+ - check-artifacts
48+
49+ test-in-src-dir-module-variant :
50+ title : Test mono repo projects in source dir, module and variant set
51+ steps :
52+ - change-workdir :
53+ title : cd $ORIG_BITRISE_SOURCE_DIR
54+ inputs :
55+ - path : $ORIG_BITRISE_SOURCE_DIR
56+ - script :
57+ inputs :
58+ - content : rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
59+ - change-workdir :
60+ title : cd $ORIG_BITRISE_SOURCE_DIR/_tmp
61+ inputs :
62+ - path : ./_tmp
63+ - is_create_path : true
64+ - script :
65+ inputs :
66+ - content : git clone -b no-failures $SAMPLE_REPO_GIT_CLONE_URL .
67+ - install-missing-android-tools :
68+ inputs :
69+ - gradlew_path : ./gradlew
4270 - path::./ :
43- title : Test simple android project with module and variant set
71+ title : Android Unit Test (monorepo in source dir, with module and variant set)
4472 inputs :
4573 - module : app
4674 - variant : Debug
75+ after-run :
76+ - check-artifacts
4777
4878 test-in-root-tmp-dir :
4979 title : Test android project & mono repo projects in /tmp dir
@@ -64,7 +94,36 @@ workflows:
6494 inputs :
6595 - gradlew_path : ./gradlew
6696 - path::./ :
67- title : Test simple repo
97+ title : Android Unit Test (android project & mono repo projects in /tmp dir)
98+ after-run :
99+ - check-artifacts
100+
101+ test-gradle-kts :
102+ title : Test android project with build.gradle.kts
103+ steps :
104+ - change-workdir :
105+ title : cd $ORIG_BITRISE_SOURCE_DIR
106+ inputs :
107+ - path : $ORIG_BITRISE_SOURCE_DIR
108+ - script :
109+ inputs :
110+ - content : rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
111+ - change-workdir :
112+ title : cd $ORIG_BITRISE_SOURCE_DIR/_tmp
113+ inputs :
114+ - path : ./_tmp
115+ - is_create_path : true
116+ - script :
117+ inputs :
118+ - content : git clone $SAMPLE_REPO_KOTLIN_GRADLE_URL .
119+ - install-missing-android-tools :
120+ inputs :
121+ - gradlew_path : ./gradlew
122+ - path::./ :
123+ title : Android Unit Test (android project with build.gradle.kts)
124+ after-run :
125+ - check-artifacts
126+
68127
69128 check-artifacts :
70129 steps :
@@ -105,6 +164,24 @@ workflows:
105164
106165 check-testaddon-export :
107166 steps :
167+ - change-workdir :
168+ title : cd $ORIG_BITRISE_SOURCE_DIR
169+ inputs :
170+ - path : $ORIG_BITRISE_SOURCE_DIR
171+ - script :
172+ inputs :
173+ - content : rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
174+ - change-workdir :
175+ title : cd $ORIG_BITRISE_SOURCE_DIR/_tmp
176+ inputs :
177+ - path : ./_tmp
178+ - is_create_path : true
179+ - script :
180+ inputs :
181+ - content : git clone -b no-failures $SAMPLE_REPO_GIT_CLONE_URL .
182+ - install-missing-android-tools :
183+ inputs :
184+ - gradlew_path : ./gradlew
108185 - script :
109186 title : purge previous build artifacts
110187 inputs :
@@ -134,7 +211,7 @@ workflows:
134211
135212 # check result xml existense
136213 if [ ! $(find ${BITRISE_TEST_DEPLOY_DIR} -regex ".*/app-debug/TEST.*.xml" | grep -c .) -eq 2 ]; then
137- echo "ERROR: ${BITRISE_TEST_RESULT_DIR}/app-debug does not contain all test result XMLs."
214+ echo "ERROR: ${BITRISE_TEST_DEPLOY_DIR} does not contain all test result XMLs."
138215 exit 1
139216 fi
140217
0 commit comments