Skip to content

Add workflow definition for fireperf end-to-end tests #3969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/fireperf-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: FirePerf E2E Tests

on:
schedule:
- cron: 4 */4 * * * # every 4 hours at 04 minutes past the hour
workflow_dispatch: # allow triggering the workflow manually

concurrency:
group: ${{ github.workflow }}

env:
PERF_E2E_GOOGLE_SERVICES: ${{ secrets.PERF_E2E_GOOGLE_SERVICES }}
FTL_RESULTS_BUCKET: fireescape

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
environment: [ prod, autopush ]
steps:
- name: Checkout firebase-android-sdk
uses: actions/checkout@v3
- name: Checkout firebase-android-buildtools
uses: actions/checkout@v3
with:
repository: FirebasePrivate/firebase-android-buildtools
token: ${{ secrets.GOOGLE_OSS_BOT_TOKEN }}
path: firebase-android-buildtools
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: temurin
cache: gradle
- name: Set up NDK 21.4.7075529
run: |
ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
echo "y" | $SDKMANAGER "ndk;21.4.7075529"
ln -sfn ${ANDROID_SDK_ROOT}/ndk/21.4.7075529 ${ANDROID_NDK_ROOT}
echo "ANDROID_NDK_HOME=${ANDROID_NDK_ROOT}" >> $GITHUB_ENV
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up fireci
run: pip3 install -e ci/fireci
- uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- uses: google-github-actions/setup-gcloud@v0
- name: Add google-services.json
run: echo $PERF_E2E_GOOGLE_SERVICES | base64 -d > google-services.json
- name: Run fireperf end-to-end tests
run: |
fireci fireperf_e2e_test \
--plugin_repo_dir=firebase-android-buildtools \
--target_environment=${{ matrix.environment }}
- name: Notify developers upon failures
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const commit = context.sha;
const run = context.runId;
const url = `https://github.com/${owner}/${repo}/actions/runs/${run}`;

const datetime = (new Date()).toLocaleString('en-US', {
timeZone: 'America/Los_Angeles',
dateStyle: 'medium',
timeStyle: 'long',
});

const text =
`Failed on commit ${commit} at ${datetime}.

${url}`;

const { data: issues } = await github.rest.issues.listForRepo({
owner: owner,
repo: repo,
state: 'open',
labels: 'fireperf-e2e-tests'
});

if (issues.length) {
github.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: issues[0].number,
body: text,
});
} else {
github.rest.issues.create({
owner: owner,
repo: repo,
title: 'FirePerf E2E Test Failures',
body: text,
labels: ['fireperf-e2e-tests'],
assignees: ['jeremyjiang-dev', 'leotianlizhan', 'raymondlam', 'visumickey']
});
}
3 changes: 1 addition & 2 deletions ci/fireci/fireciplugins/fireperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import click
import contextlib
import logging
import os
import pathlib
Expand All @@ -38,7 +37,7 @@
)
@ci_command()
def fireperf_e2e_test(target_environment, plugin_repo_dir):
"""Run Firebase Performance end to end test."""
"""Run Firebase Performance end-to-end test."""

_logger.info('Building fireperf plugin ...')
with chdir(plugin_repo_dir):
Expand Down