1
- name : Kotlin CI
1
+ name : Kotlin CI
2
2
3
- on :
4
- push :
5
- branches :
3
+ on :
4
+ push :
5
+ branches :
6
6
- main
7
- pull_request :
8
- paths-ignore :
7
+ pull_request :
8
+ paths-ignore :
9
9
# Don't build the entire app when just changing tutorials, which have their own workflow.
10
10
- ' samples/tutorial/**'
11
11
12
- jobs :
12
+ jobs :
13
13
14
- cancel-stale-jobs :
15
- runs-on : ubuntu-latest
16
- steps :
14
+ cancel-stale-jobs :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
17
# If CI is already running for a branch when that branch is updated, cancel the older jobs.
18
- - name : Cancel Stale Jobs
19
-
20
- env :
21
- GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
22
-
23
- dokka :
24
- name : Assemble & Dokka
25
- runs-on : ubuntu-latest
26
- timeout-minutes : 20
27
- steps :
28
- - uses : actions/checkout@v2
29
- - name : set up JDK 11.0.7
30
- uses : actions/setup-java@v1
31
- with :
32
- java-version : 11.0.7
18
+ - name : Cancel Stale Jobs
19
+
20
+ env :
21
+ GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
22
+
23
+ dokka :
24
+ name : Assemble & Dokka
25
+ runs-on : ubuntu-latest
26
+ timeout-minutes : 20
27
+ steps :
28
+ - uses : actions/checkout@v2
29
+ - name : set up JDK 11.0.7
30
+ uses : actions/setup-java@v1
31
+ with :
32
+ java-version : 11.0.7
33
33
34
34
# # Actual task
35
35
- uses : burrunan/gradle-cache-action@v1
@@ -59,17 +59,17 @@ jobs:
59
59
gradle-distribution-sha-256-sum-warning : false
60
60
61
61
# These are all pretty quick so we run them on a single shard. Fewer shards, less queueing.
62
- check :
63
- name : Check
64
- runs-on : ubuntu-latest
65
- timeout-minutes : 20
66
- steps :
67
- - uses : actions/checkout@v2
68
- - uses : gradle/wrapper-validation-action@v1
69
- - name : set up JDK 11.0.7
70
- uses : actions/setup-java@v1
71
- with :
72
- java-version : 11.0.7
62
+ check :
63
+ name : Check
64
+ runs-on : ubuntu-latest
65
+ timeout-minutes : 20
66
+ steps :
67
+ - uses : actions/checkout@v2
68
+ - uses : gradle/wrapper-validation-action@v1
69
+ - name : set up JDK 11.0.7
70
+ uses : actions/setup-java@v1
71
+ with :
72
+ java-version : 11.0.7
73
73
74
74
# # Actual task
75
75
- uses : burrunan/gradle-cache-action@v1
@@ -83,24 +83,24 @@ jobs:
83
83
gradle-build-scan-report : false
84
84
gradle-distribution-sha-256-sum-warning : false
85
85
86
- instrumentation-tests :
87
- name : Instrumentation tests
88
- runs-on : macos-latest
89
- timeout-minutes : 45
90
- strategy :
86
+ instrumentation-tests :
87
+ name : Instrumentation tests
88
+ runs-on : macos-latest
89
+ timeout-minutes : 45
90
+ strategy :
91
91
# Allow tests to continue on other devices if they fail on one device.
92
- fail-fast : false
93
- matrix :
94
- api-level :
92
+ fail-fast : false
93
+ matrix :
94
+ api-level :
95
95
- 29
96
96
# Unclear that older versions actually honor command to disable animation.
97
97
# Newer versions are reputed to be too slow: https://github.com/ReactiveCircus/android-emulator-runner/issues/222
98
- steps :
99
- - uses : actions/checkout@v2
100
- - name : set up JDK 11.0.7
101
- uses : actions/setup-java@v1
102
- with :
103
- java-version : 11.0.7
98
+ steps :
99
+ - uses : actions/checkout@v2
100
+ - name : set up JDK 11.0.7
101
+ uses : actions/setup-java@v1
102
+ with :
103
+ java-version : 11.0.7
104
104
105
105
# # Build before running tests, using cache.
106
106
- uses : burrunan/gradle-cache-action@v1
@@ -115,69 +115,66 @@ jobs:
115
115
gradle-distribution-sha-256-sum-warning : false
116
116
117
117
# # Actual task
118
- - name : Instrumentation Tests
119
- uses : reactivecircus/android-emulator-runner@v2
120
- with :
118
+ - name : Instrumentation Tests
119
+ uses : reactivecircus/android-emulator-runner@v2
120
+ with :
121
121
# @ychescale9 suspects Galaxy Nexus is the fastest one
122
- profile : Galaxy Nexus
123
- api-level : ${{ matrix.api-level }}
124
- arch : x86_64
122
+ profile : Galaxy Nexus
123
+ api-level : ${{ matrix.api-level }}
124
+ arch : x86_64
125
125
# Skip the benchmarks as this is running on emulators
126
- script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck --no-daemon --stacktrace
126
+ script : ./gradlew connectedCheck -x :benchmarks:dungeon-benchmark:connectedCheck -x :benchmarks:performance-poetry:complex-benchmark:connectedCheck --no-daemon --stacktrace
127
127
128
- - name : Upload results
129
- if : ${{ always() }}
130
- uses : actions/upload-artifact@v2
131
- with :
132
- name : instrumentation-test-results-${{ matrix.api-level }}
133
- path : ./**/build/reports/androidTests/connected/**
128
+ - name : Upload results
129
+ if : ${{ always() }}
130
+ uses : actions/upload-artifact@v2
131
+ with :
132
+ name : instrumentation-test-results-${{ matrix.api-level }}
133
+ path : ./**/build/reports/androidTests/connected/**
134
134
135
- upload-to-mobiledev :
136
- name : mobile.dev | Build & Upload
135
+ upload-to-mobiledev :
136
+ name : mobile.dev | Build & Upload
137
137
runs-on : ubuntu-latest
138
- timeout-minutes : 20
138
+ timeout-minutes : 20
139
139
steps :
140
- - uses : actions/checkout@v2
141
- - name : set up JDK 11.0.7
142
- uses : actions/setup-java@v1
143
- with :
144
- java-version : 11.0.7
145
-
146
- # # Build artifact, using cache.
147
- - uses : burrunan/gradle-cache-action@v1
148
- name : Build Performance Poetry APK
149
- with :
150
- gradle-dependencies-cache-key : |
140
+ - uses : actions/checkout@v2
141
+ - name : set up JDK 11.0.7
142
+ uses : actions/setup-java@v1
143
+ with :
144
+ java-version : 11.0.7
145
+
146
+ # # Build artifact for upload with cache
147
+ - uses : burrunan/gradle-cache-action@v1
148
+ name : Build Performance Poetry APK
149
+ with :
150
+ gradle-dependencies-cache-key : |
151
151
gradle/libs.versions.toml
152
- arguments : |
153
- : benchmarks:performance-poetry:complex-poetry:assembleRelease --no-daemon --stacktrace
154
- concurrent : true
155
- gradle-build-scan-report : false
156
- gradle-distribution-sha-256-sum-warning : false
152
+ arguments : |
153
+ benchmarks:performance-poetry:complex-poetry:assembleRelease --no-daemon --stacktrace
154
+ concurrent : true
155
+ gradle-build-scan-report : false
156
+ gradle-distribution-sha-256-sum-warning : false
157
157
158
158
# # Upload with POST
159
- - name : Upload Poetry to mobile.dev
160
- run : |
161
- curl -X POST \
159
+ - name : Upload Poetry to mobile.dev
160
+ id : upload_apk
161
+ run : |
162
+ #!/usr/bin/env bash
163
+ set -e
164
+ set -x
165
+ RESPONSE_ID=$(curl -X POST \
162
166
-H 'Content-Type: multipart/form-data' \
163
167
-H "Authorization: Bearer $MOBILE_DEV_API_KEY" \
164
168
--data-binary "@$APP_FILE" \
165
- https://api.mobile.dev/apk > mobile-dev.json
166
- env :
169
+ https://api.mobile.dev/apk | jq -r .id)
170
+ echo "::set-output name=apk_id::$RESPONSE_ID"
171
+ env :
167
172
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}
168
- APP_FILE : benchmarks/performance-poetry/complex-poetry/build/outputs/apk/release/complex-poetry-release-unsigned.apk
169
-
170
- # # Extract ID
171
- - name : Get JSON Property
172
- uses : notiz-dev/github-action-json-property@release
173
- id : upload_id
174
- with :
175
- path : ' mobile-dev.json'
176
- prop_path : ' id'
173
+ APP_FILE : benchmarks/performance-poetry/complex-poetry/build/outputs/apk/release/complex-poetry-release.apk
177
174
178
175
# # Start analysis
179
- - name : Start analysis on mobile.dev
180
- run : |
176
+ - name : Start analysis on mobile.dev
177
+ run : |
181
178
#!/usr/bin/env bash
182
179
set -e
183
180
set -x
@@ -192,8 +189,8 @@ jobs:
192
189
-H "Authorization: Bearer $MOBILE_DEV_API_KEY" \
193
190
https://api.mobile.dev/analysis \
194
191
--data "{\"benchmarkName\": \"$BENCHMARK_NAME\", \"apkId\": \"$APP_ID\", \"branch\": \"$BRANCH_NAME\"$PR_DATA}"
195
- env :
196
- APP_ID : ${{ steps.upload_id .outputs.prop }}
192
+ env :
193
+ APP_ID : ${{ steps.upload_apk .outputs.apk_id }}
197
194
MOBILE_DEV_API_KEY : ${{ secrets.MOBILE_DEV_API_KEY }}
198
195
REPO_OWNER : ${{ github.repository_owner }}
199
196
REPO_NAME : ${{ github.repository }}
0 commit comments