|
1 | 1 | name: Health Metrics
|
2 | 2 |
|
3 |
| -on: [ pull_request, push ] |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - labeled |
| 7 | + - opened |
| 8 | + - reopened |
| 9 | + - synchronize |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - master |
| 13 | + # add other feature branches here |
| 14 | + # TODO(yifany): support workflow_dispatch for metric tests (or only for startup time test) |
4 | 15 |
|
5 | 16 | env:
|
6 | 17 | GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
|
7 | 18 |
|
8 | 19 | jobs:
|
9 | 20 | coverage:
|
10 | 21 | name: Coverage
|
11 |
| - if: (github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) |
| 22 | + if: | |
| 23 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 24 | + || (github.event_name == 'pull_request' |
| 25 | + && github.event.pull_request.head.repo.full_name == github.repository) |
12 | 26 | runs-on: ubuntu-latest
|
13 | 27 | steps:
|
14 | 28 | - uses: actions/checkout@v3
|
|
40 | 54 |
|
41 | 55 | size:
|
42 | 56 | name: Size
|
43 |
| - if: (github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) |
| 57 | + if: | |
| 58 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 59 | + || (github.event_name == 'pull_request' |
| 60 | + && github.event.pull_request.head.repo.full_name == github.repository) |
44 | 61 | runs-on: ubuntu-latest
|
45 | 62 | steps:
|
46 | 63 | - uses: actions/checkout@v3
|
|
69 | 86 | - name: Run size tests (post-submit)
|
70 | 87 | if: ${{ github.event_name == 'push' }}
|
71 | 88 | run: fireci binary_size
|
| 89 | + |
| 90 | + startup_time: |
| 91 | + name: Startup Time |
| 92 | + if: | # In case of pull requests, label "startup-time" is required to trigger |
| 93 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 94 | + || (github.event_name == 'pull_request' |
| 95 | + && github.event.label.name == 'health-metric-test: startup-time' |
| 96 | + && github.event.pull_request.head.repo.full_name == github.repository) |
| 97 | + runs-on: ubuntu-latest |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v3 |
| 100 | + with: |
| 101 | + fetch-depth: 2 |
| 102 | + submodules: true |
| 103 | + - name: Set up JDK 11 |
| 104 | + uses: actions/setup-java@v2 |
| 105 | + with: |
| 106 | + java-version: 11 |
| 107 | + distribution: temurin |
| 108 | + cache: gradle |
| 109 | + - name: Set up Python 3.10 |
| 110 | + uses: actions/setup-python@v4 |
| 111 | + with: |
| 112 | + python-version: '3.10' |
| 113 | + - uses: google-github-actions/auth@v0 |
| 114 | + with: |
| 115 | + credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}' |
| 116 | + - uses: google-github-actions/setup-gcloud@v0 |
| 117 | + - name: Set up fireci |
| 118 | + run: pip3 install -e ci/fireci |
| 119 | + - name: Run startup-time tests (presubmit) |
| 120 | + if: ${{ github.event_name == 'pull_request' }} |
| 121 | + run: fireci macrobenchmark ci --pull-request |
| 122 | + - name: Run startup-time tests (post-submit) |
| 123 | + if: ${{ github.event_name == 'push' }} |
| 124 | + run: fireci macrobenchmark ci --push |
0 commit comments