Skip to content

Commit

Permalink
replace App Center with BrowserStack
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Nov 21, 2024
1 parent 63ade55 commit daffd87
Show file tree
Hide file tree
Showing 12 changed files with 301 additions and 186 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Android AppCenter Tests
name: Android BrowserStack Tests

on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- 'binding/android/LeopardTestApp/**'
- '.github/workflows/android-appcenter.yml'
- '.github/workflows/android-browserstack.yml'
- 'resources/audio_samples/**'
- 'resources/.test/**'
pull_request:
branches: [ master, 'v[0-9]+.[0-9]+' ]
paths:
- 'binding/android/LeopardTestApp/**'
- '.github/workflows/android-appcenter.yml'
- '.github/workflows/android-browserstack.yml'
- 'resources/audio_samples/**'
- 'resources/.test/**'

Expand All @@ -23,19 +23,18 @@ defaults:

jobs:
build:
name: Run Android Tests on AppCenter
name: Run Android Tests on BrowserStack
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js LTS
uses: actions/setup-node@v3
- name: Installing Python
uses: actions/setup-python@v5
with:
node-version: lts/*

- name: Install AppCenter CLI
run: npm install -g appcenter-cli
python-version: '3.10'
- run:
pip3 install requests

- name: set up JDK 11
uses: actions/setup-java@v3
Expand Down Expand Up @@ -68,30 +67,29 @@ jobs:
- name: Build androidTest
run: ./gradlew assembleEnDebugAndroidTest

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Leopard-Android"
--devices "Picovoice/android-min-max"
--app-path leopard-test-app/build/outputs/apk/en/debug/leopard-test-app-en-debug.apk
--test-series "leopard-android"
--locale "en_US"
--build-dir leopard-test-app/build/outputs/apk/androidTest/en/debug
- name: Run tests on BrowserStack
run: python3 ../../../script/automation/browserstack.py
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Leopard-Android"
--devices "android-min-max"
--app_path "leopard-test-app/build/outputs/apk/en/debug/leopard-test-app-en-debug.apk"
--test_path "leopard-test-app/build/outputs/apk/en/androidTest/debug/leopard-test-app-en-debug-androidTest.apk"

build-integ:
name: Run Android Integration Tests on AppCenter
name: Run Android Integration Tests on BrowserStack
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js LTS
uses: actions/setup-node@v3
- name: Installing Python
uses: actions/setup-python@v5
with:
node-version: lts/*

- name: Install AppCenter CLI
run: npm install -g appcenter-cli
python-version: '3.10'
- run:
pip3 install requests

- name: set up JDK 11
uses: actions/setup-java@v3
Expand Down Expand Up @@ -124,13 +122,13 @@ jobs:
- name: Build androidTest
run: ./gradlew assembleEnReleaseAndroidTest -DtestBuildType=integ

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Leopard-Android"
--devices "Picovoice/android-min-max"
--app-path leopard-test-app/build/outputs/apk/en/release/leopard-test-app-en-release.apk
--test-series "leopard-android"
--locale "en_US"
--build-dir leopard-test-app/build/outputs/apk/androidTest/en/release
- name: Run tests on BrowserStack
run: python3 ../../../script/automation/browserstack.py
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Leopard-Android-Integration"
--devices "android-min-max"
--app_path "leopard-test-app/build/outputs/apk/en/release/leopard-test-app-en-release.apk"
--test_path "leopard-test-app/build/outputs/apk/androidTest/en/release/leopard-test-app-en-release-androidTest.apk"

38 changes: 17 additions & 21 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,26 @@ defaults:

jobs:
build:
name: Run Android Speed Tests on AppCenter
name: Run Android Speed Tests on BrowserStack
runs-on: ubuntu-latest

strategy:
matrix:
device: [single-android, 32bit-android]
device: [ android-perf ]
include:
- device: single-android
- device: android-perf
initPerformanceThresholdSec: 6.0
procPerformanceThresholdSec: 1.0
- device: 32bit-android
initPerformanceThresholdSec: 18.0
procPerformanceThresholdSec: 7.0

steps:
- uses: actions/checkout@v3

- name: Set up Node.js LTS
uses: actions/setup-node@v3
- name: Installing Python
uses: actions/setup-python@v5
with:
node-version: lts/*

- name: Install AppCenter CLI
run: npm install -g appcenter-cli
python-version: '3.10'
- run:
pip3 install requests

- name: set up JDK 11
uses: actions/setup-java@v3
Expand Down Expand Up @@ -86,12 +82,12 @@ jobs:
- name: Build androidTest
run: ./gradlew assembleEnDebugAndroidTest -DtestBuildType=perf

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Leopard-Android"
--devices "Picovoice/${{ matrix.device }}"
--app-path leopard-test-app/build/outputs/apk/en/debug/leopard-test-app-en-debug.apk
--test-series "leopard-android"
--locale "en_US"
--build-dir leopard-test-app/build/outputs/apk/androidTest/en/debug
- name: Run tests on BrowserStack
run: python3 ../../../script/automation/browserstack.py
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Leopard-Android-Performance"
--devices "${{ matrix.device }}"
--app_path "leopard-test-app/build/outputs/apk/en/debug/leopard-test-app-en-debug.apk"
--test_path "leopard-test-app/build/outputs/apk/androidTest/en/debug/leopard-test-app-en-debug-androidTest.apk"
73 changes: 0 additions & 73 deletions .github/workflows/ios-appcenter.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/ios-browserstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: iOS BrowserStack Tests

on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- 'binding/ios/LeopardAppTest/Podfile.lock'
- '.github/workflows/ios-browserstack.yml'
pull_request:
branches: [ master, 'v[0-9]+.[0-9]+' ]
paths:
- 'binding/ios/LeopardAppTest/Podfile.lock'
- '.github/workflows/ios-browserstack.yml'

defaults:
run:
working-directory: binding/ios/LeopardAppTest

jobs:
build:
name: Run iOS Tests on BrowserStack
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Installing Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run:
pip3 install requests

- name: Install Cocoapods
run: gem install cocoapods

- name: Install AppCenter CLI
run: npm install -g appcenter-cli

- name: Make build dir
run: mkdir ddp

- name: Copy test_resources
run: ./copy_test_resources.sh

- name: Run Cocoapods
run: pod install

- name: Inject AccessKey
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
LeopardAppTestUITests/LeopardAppTestUITests.swift

- name: XCode Build
run: xcrun xcodebuild build-for-testing
-configuration Debug
-workspace LeopardAppTest.xcworkspace
-sdk iphoneos
-scheme LeopardAppTest
-derivedDataPath ddp
CODE_SIGNING_ALLOWED=NO

- name: Generating ipa
run: cd ddp/Build/Products/Debug-iphoneos/ &&
mkdir Payload &&
cp -r LeopardAppTest.app Payload &&
zip --symlinks -r LeopardAppTest.ipa Payload &&
rm -r Payload

- name: Zipping Tests
run: cd ddp/Build/Products/Debug-iphoneos/ &&
zip --symlinks -r LeopardAppTestUITests.zip LeopardAppTestUITests-Runner.app

- name: Run tests on BrowserStack
run: python3 ../../../script/automation/browserstack.py
--type xcuitest
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Leopard-iOS"
--devices "ios-min-max"
--app_path "ddp/Build/Products/Debug-iphoneos/LeopardAppTest.ipa"
--test_path "ddp/Build/Products/Debug-iphoneos/LeopardAppTestUITests.zip"
3 changes: 0 additions & 3 deletions .github/workflows/ios-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
- name: Install Cocoapods
run: gem install cocoapods

- name: Install AppCenter CLI
run: npm install -g appcenter-cli

- name: Make build dir
run: mkdir ddp

Expand Down
Loading

0 comments on commit daffd87

Please sign in to comment.