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