Skip to content

Commit 4c18b2e

Browse files
committed
[#448] Remove template-compose specification on workflow in .cicdtemplate
1 parent c27f7f3 commit 4c18b2e

File tree

2 files changed

+32
-69
lines changed

2 files changed

+32
-69
lines changed

.cicdtemplate/.codemagic/codemagic.yaml

Lines changed: 27 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,25 @@ definitions:
1111
- $HOME/.gradle/caches
1212
scripts:
1313
- &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
1515
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
2322
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
3525
script: ./gradlew koverMergedReport
3626
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
4130
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
4433
<<: *configure_environment
4534
triggering:
4635
events:
@@ -59,37 +48,13 @@ workflows:
5948
cancel_previous_builds: true
6049
scripts:
6150
- *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
8853
artifacts:
89-
- *artifacts_template_xml
54+
- *artifacts_test_report
9055

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
9358
<<: *configure_environment
9459
triggering:
9560
events:
@@ -98,14 +63,13 @@ workflows:
9863
- pattern: develop
9964
scripts:
10065
- *set_up_google_services_files_from_environment_variables
101-
- *detekt_on_template_compose
102-
- *unit_test_on_template_compose
66+
- *detekt
67+
- *unit_test
10368
- name: Build APK for staging
104-
working_directory: ./template-compose
10569
script: |
10670
./gradlew assembleStagingDebug -PversionCode=$BUILD_NUMBER
10771
artifacts:
108-
- *artifacts_template_compose
72+
- *artifacts_test_report
10973
- *artifacts_staging_apk
11074
publishing:
11175
firebase:
@@ -116,8 +80,8 @@ workflows:
11680
- android-chapter
11781
artifact_type: 'apk'
11882

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
12185
<<: *configure_environment
12286
triggering:
12387
events:
@@ -126,14 +90,13 @@ workflows:
12690
- pattern: main
12791
scripts:
12892
- *set_up_google_services_files_from_environment_variables
129-
- *detekt_on_template_compose
130-
- *unit_test_on_template_compose
93+
- *detekt
94+
- *unit_test
13195
- name: Build APK for production
132-
working_directory: ./template-compose
13396
script: |
13497
./gradlew assembleProductionDebug -PversionCode=$BUILD_NUMBER
13598
artifacts:
136-
- *artifacts_template_compose
99+
- *artifacts_test_report
137100
- *artifacts_production_apk
138101
publishing:
139102
firebase:

.cicdtemplate/.github/workflows/deploy_staging_and_production_to_firebase_app_distribution.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ jobs:
3939
restore-keys: |
4040
${{ runner.os }}-gradle-
4141
42-
- name: Set up google-services.json on template-compose
42+
- name: Set up google-services.json files
4343
env:
4444
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
4545
GOOGLE_SERVICES_JSON_STAGING: ${{ secrets.GOOGLE_SERVICES_JSON_STAGING }}
4646
run: |
47-
mkdir -p template-compose/app/src/production
48-
echo $GOOGLE_SERVICES_JSON > template-compose/app/src/production/google-services.json
49-
mkdir -p template-compose/app/src/staging
50-
echo $GOOGLE_SERVICES_JSON_STAGING > template-compose/app/src/staging/google-services.json
47+
mkdir -p app/src/production
48+
echo $GOOGLE_SERVICES_JSON > app/src/production/google-services.json
49+
mkdir -p app/src/staging
50+
echo $GOOGLE_SERVICES_JSON_STAGING > app/src/staging/google-services.json
5151
5252
- name: Run Detekt
5353
run: ./gradlew detekt

0 commit comments

Comments
 (0)