Run Appium Tests and Send to Firebase #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Appium Tests and Send to Firebase | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" # Run every day at midnight | |
jobs: | |
run-appium-tests: | |
runs-on: | |
- self-hosted | |
- macOS | |
- X64 | |
- firebase-perf-reverse-proxy | |
env: | |
ANDROID_PERFORMANCE_GA_SERVICE_ACCOUNT: ${{ secrets.ANDROID_PERFORMANCE_GA_SERVICE_ACCOUNT }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r ./android-performance/requirements.txt | |
pip install Appium-Python-Client | |
pip install gspread google-auth | |
- name: Start Appium Server | |
run: | | |
appium & # Start Appium server in the background | |
sleep 5 # Wait for the server to start | |
- name: Set Network Type and Timestamp | |
run: | | |
echo "NETWORK_TYPE=5G" >> $GITHUB_ENV | |
echo "TIMESTAMP=$(date '+%Y%m%d_%H%M%S')" >> $GITHUB_ENV | |
- name: Start Network Throttling | |
run: | | |
bash ./android-performance/network_throttle start 5G | |
- name: Run Appium Tests - Chrome | |
run: | | |
python ./android-performance/chrome.py --network ${{ env.NETWORK_TYPE }} --timestamp ${{ env.TIMESTAMP }} | |
env: | |
NETWORK_TYPE: ${{ env.NETWORK_TYPE }} | |
TIMESTAMP: ${{ env.TIMESTAMP }} | |
- name: Run Appium Tests - Firefox | |
run: | | |
python ./android-performance/firefox.py --network ${{ env.NETWORK_TYPE }} --timestamp ${{ env.TIMESTAMP }} | |
env: | |
NETWORK_TYPE: ${{ env.NETWORK_TYPE }} | |
TIMESTAMP: ${{ env.TIMESTAMP }} | |
- name: Add Performance Difference Firefox vs. Chrome | |
run: | | |
python ./android-performance/add_perf_diff.py --network ${{ env.NETWORK_TYPE }} --timestamp ${{ env.TIMESTAMP }} | |
env: | |
NETWORK_TYPE: ${{ env.NETWORK_TYPE }} | |
TIMESTAMP: ${{ env.TIMESTAMP }} | |
- name: Upload Test Results | |
run: | | |
python ./android-performance/upload_test_results.py |