@@ -11,36 +11,25 @@ definitions:
11
11
- $HOME/.gradle/caches
12
12
scripts :
13
13
- &set_up_google_services_files_from_environment_variables
14
- name : Set up google-services.json on template-compose
14
+ name : Set up google-services.json files
15
15
script : |
16
- mkdir -p template-compose/app/src/production
17
- echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
18
- mkdir -p template-compose/app/src/staging
19
- echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
20
- - &detekt_on_template_compose
21
- name : Run detekt on template-compose
22
- working_directory : ./template-compose
16
+ mkdir -p app/src/production
17
+ echo $GOOGLE_SERVICES_JSON > app/src/production/google-services.json
18
+ mkdir -p app/src/staging
19
+ echo $GOOGLE_SERVICES_JSON_STAGING > app/src/staging/google-services.json
20
+ - &detekt
21
+ name : Run detekt
23
22
script : ./gradlew detekt
24
- - &detekt_on_template_xml
25
- name : Run detekt on template-xml
26
- working_directory : ./template-xml
27
- script : ./gradlew detekt
28
- - &unit_test_on_template_compose
29
- name : Run unit tests on template-compose
30
- working_directory : ./template-compose
31
- script : ./gradlew koverMergedReport
32
- - &unit_test_on_template_xml
33
- name : Run unit tests on template-xml
34
- working_directory : ./template-xml
23
+ - &unit_test
24
+ name : Run unit tests
35
25
script : ./gradlew koverMergedReport
36
26
artifacts :
37
- - &artifacts_template_compose template-compose/build/reports/kover/merged/
38
- - &artifacts_template_xml template-xml/build/reports/kover/merged/
39
- - &artifacts_staging_apk template-compose/app/build/outputs/apk/staging/debug/app-staging-debug.apk
40
- - &artifacts_production_apk template-compose/app/build/outputs/apk/production/debug/app-production-debug.apk
27
+ - &artifacts_test_report build/reports/kover/merged/
28
+ - &artifacts_staging_apk app/build/outputs/apk/staging/debug/app-staging-debug.apk
29
+ - &artifacts_production_apk app/build/outputs/apk/production/debug/app-production-debug.apk
41
30
workflows :
42
- unit-test-on-pr-for-template-compose :
43
- name : Unit test on PR for template-compose
31
+ unit-test-on-pr :
32
+ name : Unit test on PR
44
33
<< : *configure_environment
45
34
triggering :
46
35
events :
@@ -59,37 +48,13 @@ workflows:
59
48
cancel_previous_builds : true
60
49
scripts :
61
50
- *set_up_google_services_files_from_environment_variables
62
- - *detekt_on_template_compose
63
- - *unit_test_on_template_compose
64
- artifacts :
65
- - *artifacts_template_compose
66
-
67
- unit-test-on-pr-for-template-xml :
68
- name : Unit test on PR for template-xml
69
- << : *configure_environment
70
- triggering :
71
- events :
72
- # Run when a pull request is opened or updated
73
- - pull_request
74
- branch_patterns :
75
- # Review changes BEFORE they’re merged into any branches
76
- - pattern : ' *'
77
- source : false
78
- # Will not run on develop branch as it is already covered by build-and-deploy-template-compose-staging
79
- - pattern : ' develop'
80
- include : false
81
- # Will not run on main branch as it is already covered by build-and-deploy-template-compose-production
82
- - pattern : ' main'
83
- include : false
84
- cancel_previous_builds : true
85
- scripts :
86
- - *detekt_on_template_xml
87
- - *unit_test_on_template_xml
51
+ - *detekt
52
+ - *unit_test
88
53
artifacts :
89
- - *artifacts_template_xml
54
+ - *artifacts_test_report
90
55
91
- build-and-deploy-template-compose- staging :
92
- name : Build and deploy template-compose staging to Firebase App Distribution
56
+ build-and-deploy-staging :
57
+ name : Build and deploy staging to Firebase App Distribution
93
58
<< : *configure_environment
94
59
triggering :
95
60
events :
@@ -98,14 +63,13 @@ workflows:
98
63
- pattern : develop
99
64
scripts :
100
65
- *set_up_google_services_files_from_environment_variables
101
- - *detekt_on_template_compose
102
- - *unit_test_on_template_compose
66
+ - *detekt
67
+ - *unit_test
103
68
- name : Build APK for staging
104
- working_directory : ./template-compose
105
69
script : |
106
70
./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER
107
71
artifacts :
108
- - *artifacts_template_compose
72
+ - *artifacts_test_report
109
73
- *artifacts_staging_apk
110
74
publishing :
111
75
firebase :
@@ -116,8 +80,8 @@ workflows:
116
80
- android-chapter
117
81
artifact_type : ' apk'
118
82
119
- build-and-deploy-template-compose- production :
120
- name : Build and deploy template-compose production to Firebase App Distribution
83
+ build-and-deploy-production :
84
+ name : Build and deploy production to Firebase App Distribution
121
85
<< : *configure_environment
122
86
triggering :
123
87
events :
@@ -126,14 +90,13 @@ workflows:
126
90
- pattern : main
127
91
scripts :
128
92
- *set_up_google_services_files_from_environment_variables
129
- - *detekt_on_template_compose
130
- - *unit_test_on_template_compose
93
+ - *detekt
94
+ - *unit_test
131
95
- name : Build APK for production
132
- working_directory : ./template-compose
133
96
script : |
134
97
./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER
135
98
artifacts :
136
- - *artifacts_template_compose
99
+ - *artifacts_test_report
137
100
- *artifacts_production_apk
138
101
publishing :
139
102
firebase :
0 commit comments