7
7
# closed will be triggered when a pull request is closed.
8
8
types : [opened, synchronize, closed]
9
9
10
+ env :
11
+ METRICS_SERVICE_SECRET : ${{ secrets.GHASecretsGPGPassphrase1 }}
12
+
10
13
jobs :
11
14
check :
12
15
if : github.repository == 'Firebase/firebase-ios-sdk' && (github.event.action == 'opened' || github.event.action == 'synchronize')
35
38
id : check_files
36
39
env :
37
40
pr_branch : ${{ github.event.pull_request.head.ref }}
38
- run : ./scripts/code_coverage_report/get_updated_files.sh
41
+ run : |
42
+ if [ ! -z "${{ env.METRICS_SERVICE_SECRET }}" ]; then
43
+ ./scripts/code_coverage_report/get_updated_files.sh
44
+ fi
39
45
40
46
pod-lib-lint-database :
41
47
needs : check
@@ -269,14 +275,12 @@ jobs:
269
275
270
276
create_report :
271
277
needs : [check, pod-lib-lint-abtesting, pod-lib-lint-auth, pod-lib-lint-database, pod-lib-lint-dynamiclinks, pod-lib-lint-firestore, pod-lib-lint-functions, pod-lib-lint-inappmessaging, pod-lib-lint-instanceid, pod-lib-lint-messaging, pod-lib-lint-performance, pod-lib-lint-remoteconfig, pod-lib-lint-storage]
272
- env :
273
- metrics_service_secret : ${{ secrets.GHASecretsGPGPassphrase1 }}
274
278
if : always()
275
279
runs-on : macOS-latest
276
280
steps :
277
281
- uses : actions/checkout@v2
278
282
- name : Access to Metrics Service
279
- if : env.metrics_service_secret
283
+ if : ${{ env.METRICS_SERVICE_SECRET }}
280
284
run : |
281
285
# Install gcloud sdk
282
286
curl https://sdk.cloud.google.com > install.sh
@@ -286,14 +290,14 @@ jobs:
286
290
287
291
# Activate the service account for Metrics Service.
288
292
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/metrics_service_access.json.gpg \
289
- metrics-access.json "$metrics_service_secret "
293
+ metrics-access.json "${{ env.METRICS_SERVICE_SECRET }} "
290
294
gcloud auth activate-service-account --key-file metrics-access.json
291
295
- uses : actions/download-artifact@v2
292
296
id : download
293
297
with :
294
298
path : /Users/runner/test
295
299
- name : Compare Diff and Post a Report
296
- if : github.event_name == 'pull_request' && env.metrics_service_secret
300
+ if : github.event_name == 'pull_request' && ${{ env.METRICS_SERVICE_SECRET }}
297
301
env :
298
302
base_commit : ${{ needs.check.outputs.base_commit }}
299
303
run : |
@@ -304,7 +308,7 @@ jobs:
304
308
swift run CoverageReportGenerator --presubmit "firebase/firebase-ios-sdk" --commit "${GITHUB_SHA}" --token $(gcloud auth print-identity-token) --xcresult-dir "/Users/runner/test/codecoverage" --log-link "https://github.com/firebase/firebase-ios-sdk/actions/runs/${GITHUB_RUN_ID}" --pull-request-num ${{github.event.pull_request.number}} --base-commit "$base_commit"
305
309
fi
306
310
- name : Update New Coverage Data
307
- if : github.event.pull_request.merged == true && env.metrics_service_secret
311
+ if : github.event.pull_request.merged == true && ${{ env.METRICS_SERVICE_SECRET }}
308
312
run : |
309
313
if [ -d "${{steps.download.outputs.download-path}}" ]; then
310
314
cd scripts/code_coverage_report/generate_code_coverage_report
0 commit comments