-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
183 lines (182 loc) · 5.22 KB
/
codemagic.yaml
File metadata and controls
183 lines (182 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Has separate flows for develop branch (automatic builds) and
# Merge Request (automatic builds)
definitions:
generated-app-artifacts: &generatedAppArtifacts
- emulator.log
- p42app/app/build/reports
- p42app/app/build/outputs/androidTest-results
- p42app/app/build/outputs/logs
- p42app/app/build/outputs/**/*.apk
- p42app/app/build/outputs/**/mapping.txt
generated-lib-artifacts: &generatedLibArtifacts
- emulator.log
- p42lib/sample/build/reports
- p42lib/sample/outputs/androidTest-results
- p42lib/sample/build/outputs/logs
- p42lib/sample/build/outputs/**/*.apk
- p42lib/sample/build/outputs/**/mapping.txt
- p42lib/p42lib/build/reports
- p42lib/p42lib/build/outputs/androidTest-results
- p42lib/p42lib/build/outputs/logs
- p42lib/p42lib/build/outputs/**/*.aar
- p42lib/p42lib/build/outputs/**/mapping.txt
debug-emails: &debugEmails
- lauris.kruusamae@lab.mobi
- harri.kirik@lab.mobi
- siret.jorro@lab.mobi
scripts:
# Generate app with creator script
- &stepRunCreatorScriptApp
name: Run project creator script and replace google-services.json and keystores in the generated project
script: sh ci/run_app_creator.sh
# Generate lib with creator script
- &stepRunCreatorScriptLib
name: Run project creator script
script: sh ci/run_lib_creator.sh
# Run generated app checkCode
- &stepGeneratedAppCheckCode
name: Check code style and formatting
script: |
cd p42app
./gradlew checkCode
# Run generated lib checkCode
- &stepGeneratedLibCheckCode
name: Check code style and formatting
script: |
cd p42lib
./gradlew checkCode
# Build generated app
- &stepGeneratedAppBuild
name: Build Android
script: |
cd p42app
./gradlew buildAllRelease
# Build generated library and sample app
- &stepGeneratedLibBuild
name: Build library and sample app
script: |
cd p42lib
./gradlew buildAll
# Start emulator
- &stepStartEmulator
name: Launch emulator
script: |
cd $ANDROID_HOME/tools
emulator -avd emulator &
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
# Stop emulator
- &stepStopEmulator
name: Stop emulator
script: |
cd $ANDROID_HOME/tools
adb emu kill
# Run generated app tests
- &stepGeneratedAppRunTests
name: Test Android
script: |
cd p42app
sh ../ci/run_tests.sh
# Run generated lib sample app tests
- &stepGeneratedLibRunTests
name: Test Android
script: |
cd p42lib
sh ../ci/run_tests.sh
# Flows
workflows:
# Runs the project creator script and builds the debug and release versions of generated app
develop-generated-app-builds:
name: Dev generated app builds
instance_type: linux_x2
environment:
java: 17
ruby: 2.6.10
triggering:
events:
- push
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: true
cancel_previous_builds: true
scripts:
- *stepRunCreatorScriptApp
- *stepGeneratedAppCheckCode
- *stepGeneratedAppBuild
artifacts: *generatedAppArtifacts
publishing:
email:
recipients: *debugEmails
# Runs the project creator script and builds the generated library and sample app
develop-generated-lib-builds:
name: Dev generated lib builds
instance_type: linux_x2
environment:
java: 17
ruby: 2.6.10
triggering:
events:
- push
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: true
cancel_previous_builds: true
scripts:
- *stepRunCreatorScriptLib
- *stepGeneratedLibCheckCode
- *stepGeneratedLibBuild
artifacts: *generatedLibArtifacts
publishing:
email:
recipients: *debugEmails
# Runs the project creator script and builds the debug version of generated app
merge-requests-generated-app:
name: Merge requests generated app
instance_type: linux_x2
environment:
java: 17
ruby: 2.6.10
triggering:
events:
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: false
cancel_previous_builds: true
scripts:
- *stepRunCreatorScriptApp
- *stepGeneratedAppCheckCode
- *stepGeneratedAppBuild
publishing:
email:
recipients: *debugEmails
notify:
success: false
# Runs the project creator script and builds the generated library and sample app
merge-requests-generated-lib:
name: Merge requests generated lib
instance_type: linux_x2
environment:
java: 17
ruby: 2.6.10
triggering:
events:
- pull_request
branch_patterns:
- pattern: 'develop'
include: true
source: false
cancel_previous_builds: true
scripts:
- *stepRunCreatorScriptLib
- *stepGeneratedLibCheckCode
- *stepGeneratedLibBuild
publishing:
email:
recipients: *debugEmails
notify:
success: false