-
Notifications
You must be signed in to change notification settings - Fork 585
134 lines (128 loc) · 4.68 KB
/
health-metrics.yml
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
name: Health Metrics
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
# add other feature branches here
# TODO(yifany): support workflow_dispatch for metric tests (or only for startup time test)
env:
GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
jobs:
coverage:
name: Coverage
if: |
(github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.10'
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}'
- uses: google-github-actions/setup-gcloud@v2
- name: Set up fireci
run: pip3 install -e ci/fireci
- name: Run coverage tests (presubmit)
if: ${{ github.event_name == 'pull_request' }}
run: fireci coverage --pull-request
- name: Run coverage tests (post-submit)
if: ${{ github.event_name == 'push' }}
run: fireci coverage
size:
name: Size
if: |
(github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.10'
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}'
- uses: google-github-actions/setup-gcloud@v2
- name: Set up fireci
run: pip3 install -e ci/fireci
- name: Run size tests (presubmit)
if: ${{ github.event_name == 'pull_request' }}
run: fireci binary_size --pull-request
- name: Run size tests (post-submit)
if: ${{ github.event_name == 'push' }}
run: fireci binary_size
startup_time:
name: Startup Time
if: |
(github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk')
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.base.ref == 'main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v4.1.0
with:
java-version: 17
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.10'
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}'
- uses: google-github-actions/setup-gcloud@v2
- name: Set up fireci
run: pip3 install -e ci/fireci
- name: Add google-services.json
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
BENCHMARK_APP_LOCATION: health-metrics/benchmark/template/app/google-services.json
run: |
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > $BENCHMARK_APP_LOCATION
- name: Run startup-time tests (presubmit)
if: ${{ github.event_name == 'pull_request' }}
run: |
git diff --name-only HEAD~1 | \
xargs printf -- '--changed-git-paths %s\n' | \
xargs ./gradlew writeChangedProjects --output-file-path=modules.json
fireci macrobenchmark ci --pull-request --changed-modules-file modules.json
- name: Run startup-time tests (post-submit)
if: ${{ github.event_name == 'push' }}
run: |
fireci macrobenchmark ci --push