Skip to content

Disconnect from RC real-time server when app is backgrounded #6360

Disconnect from RC real-time server when app is backgrounded

Disconnect from RC real-time server when app is backgrounded #6360

name: Health Metrics
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- master
# 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@v3.5.3
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@v4
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@v3.5.3
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@v4
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 == 'master')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
with:
fetch-depth: 2
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Set up Python 3.10
uses: actions/setup-python@v4
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