|
1 | 1 | name: Health Metrics
|
2 | 2 |
|
3 |
| -on: [ pull_request, push ] |
| 3 | +concurrency: |
| 4 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 5 | + cancel-in-progress: true |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + # add other feature branches here |
| 13 | + # TODO(yifany): support workflow_dispatch for metric tests (or only for startup time test) |
4 | 14 |
|
5 | 15 | env:
|
6 | 16 | GITHUB_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
|
7 | 17 |
|
8 | 18 | jobs:
|
9 | 19 | coverage:
|
10 | 20 | 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) |
| 21 | + if: | |
| 22 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 23 | + || (github.event_name == 'pull_request' |
| 24 | + && github.event.pull_request.head.repo.full_name == github.repository) |
12 | 25 | runs-on: ubuntu-latest
|
13 | 26 | steps:
|
14 | 27 | - uses: actions/checkout@v3
|
|
40 | 53 |
|
41 | 54 | size:
|
42 | 55 | 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) |
| 56 | + if: | |
| 57 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 58 | + || (github.event_name == 'pull_request' |
| 59 | + && github.event.pull_request.head.repo.full_name == github.repository) |
44 | 60 | runs-on: ubuntu-latest
|
45 | 61 | steps:
|
46 | 62 | - uses: actions/checkout@v3
|
|
69 | 85 | - name: Run size tests (post-submit)
|
70 | 86 | if: ${{ github.event_name == 'push' }}
|
71 | 87 | run: fireci binary_size
|
| 88 | + |
| 89 | + startup_time: |
| 90 | + name: Startup Time |
| 91 | + if: | |
| 92 | + (github.event_name == 'push' && github.repository == 'firebase/firebase-android-sdk') |
| 93 | + || (github.event_name == 'pull_request' |
| 94 | + && github.event.pull_request.head.repo.full_name == github.repository) |
| 95 | + runs-on: ubuntu-latest |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v3 |
| 98 | + with: |
| 99 | + fetch-depth: 2 |
| 100 | + submodules: true |
| 101 | + - name: Set up JDK 11 |
| 102 | + uses: actions/setup-java@v2 |
| 103 | + with: |
| 104 | + java-version: 11 |
| 105 | + distribution: temurin |
| 106 | + cache: gradle |
| 107 | + - name: Set up Python 3.10 |
| 108 | + uses: actions/setup-python@v4 |
| 109 | + with: |
| 110 | + python-version: '3.10' |
| 111 | + - uses: google-github-actions/auth@v0 |
| 112 | + with: |
| 113 | + credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}' |
| 114 | + - uses: google-github-actions/setup-gcloud@v0 |
| 115 | + - name: Set up fireci |
| 116 | + run: pip3 install -e ci/fireci |
| 117 | + - name: Add google-services.json |
| 118 | + env: |
| 119 | + INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }} |
| 120 | + BENCHMARK_APP_LOCATION: health-metrics/benchmark/template/app/google-services.json |
| 121 | + run: | |
| 122 | + echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > $BENCHMARK_APP_LOCATION |
| 123 | + - name: Run startup-time tests (presubmit) |
| 124 | + if: ${{ github.event_name == 'pull_request' }} |
| 125 | + run: fireci macrobenchmark ci --pull-request |
| 126 | + - name: Run startup-time tests (post-submit) |
| 127 | + if: ${{ github.event_name == 'push' }} |
| 128 | + run: fireci macrobenchmark ci --push |
0 commit comments