Skip to content

Commit

Permalink
Merge pull request #570 from Picovoice/android-test-app
Browse files Browse the repository at this point in the history
rhino test app
  • Loading branch information
ErisMik committed Aug 17, 2023
2 parents 0201df9 + 3144bcd commit 99155ff
Show file tree
Hide file tree
Showing 37 changed files with 1,246 additions and 50 deletions.
76 changes: 71 additions & 5 deletions .github/workflows/android-appcenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
branches: [ master ]
paths:
- '.github/workflows/android-appcenter.yml'
- 'demo/android/Activity/**'
- 'binding/android/RhinoTestApp/**'
- 'resources/.test/**'
- 'resources/audio_samples/**'
pull_request:
branches: [ master, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/android-appcenter.yml'
- 'demo/android/Activity/**'
- 'binding/android/RhinoTestApp/**'
- 'resources/.test/**'
- 'resources/audio_samples/**'

defaults:
run:
working-directory: demo/android/Activity
working-directory: binding/android/RhinoTestApp/

jobs:
build:
Expand Down Expand Up @@ -49,6 +49,16 @@ jobs:
- name: Inject AccessKey
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties

- name: Inject Android keystore variables
run: |
echo storePassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyPassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyAlias=picovoice >> local.properties
echo storeFile=../picovoice.jks >> local.properties
- name: Setup Android keystore file
run: echo "${{secrets.ANDROID_RELEASE_KEYSTORE_FILE_B64}}" | base64 -d > picovoice.jks

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -63,7 +73,63 @@ jobs:
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Rhino-Android-Activity"
--devices "Picovoice/android-min-max"
--app-path rhino-activity-demo-app/build/outputs/apk/en/debug/rhino-activity-demo-app-en-debug.apk
--app-path rhino-test-app/build/outputs/apk/en/debug/rhino-test-app-en-debug.apk
--test-series "rhino-android"
--locale "en_US"
--build-dir rhino-test-app/build/outputs/apk/androidTest/en/debug

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

steps:
- uses: actions/checkout@v3

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

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

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

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

- name: Inject AccessKey
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties

- name: Inject Android keystore variables
run: |
echo storePassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyPassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyAlias=picovoice >> local.properties
echo storeFile=../picovoice.jks >> local.properties
- name: Setup Android keystore file
run: echo "${{secrets.ANDROID_RELEASE_KEYSTORE_FILE_B64}}" | base64 -d > picovoice.jks

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build app
run: ./gradlew assembleEnRelease

- name: Build androidTest
run: ./gradlew assembleEnReleaseAndroidTest -DtestBuildType=integ

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Rhino-Android-Activity"
--devices "Picovoice/android-min-max"
--app-path rhino-test-app/build/outputs/apk/en/release/rhino-test-app-en-release.apk
--test-series "rhino-android"
--locale "en_US"
--build-dir rhino-activity-demo-app/build/outputs/apk/androidTest/en/debug
--build-dir rhino-test-app/build/outputs/apk/androidTest/en/release
22 changes: 16 additions & 6 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:
branches: [ master ]
paths:
- '.github/workflows/android-perf.yml'
- 'demo/android/Activity/**/build.gradle'
- 'binding/android/RhinoTestApp/**/build.gradle'
pull_request:
branches: [ master, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/android-perf.yml'
- 'demo/android/Activity/**/build.gradle'
- 'binding/android/RhinoTestApp/**/build.gradle'

defaults:
run:
working-directory: demo/android/Activity
working-directory: binding/android/RhinoTestApp/

jobs:
build:
Expand Down Expand Up @@ -54,6 +54,16 @@ jobs:
- name: Inject AccessKey
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties

- name: Inject Android keystore variables
run: |
echo storePassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyPassword="${{secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD}}" >> local.properties
echo keyAlias=picovoice >> local.properties
echo storeFile=../picovoice.jks >> local.properties
- name: Setup Android keystore file
run: echo "${{secrets.ANDROID_RELEASE_KEYSTORE_FILE_B64}}" | base64 -d > picovoice.jks

- name: Inject Number of Iterations
run: echo numTestIterations="100" >> local.properties

Expand All @@ -67,14 +77,14 @@ jobs:
run: ./gradlew assembleEnDebug

- name: Build androidTest
run: ./gradlew assembleEnDebugAndroidTest
run: ./gradlew assembleEnDebugAndroidTest -DtestBuildType=perf

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Rhino-Android-Activity"
--devices "Picovoice/${{ matrix.device }}"
--app-path rhino-activity-demo-app/build/outputs/apk/en/debug/rhino-activity-demo-app-en-debug.apk
--app-path rhino-test-app/build/outputs/apk/en/debug/rhino-test-app-en-debug.apk
--test-series "rhino-android"
--locale "en_US"
--build-dir rhino-activity-demo-app/build/outputs/apk/androidTest/en/debug
--build-dir rhino-test-app/build/outputs/apk/androidTest/en/debug
15 changes: 15 additions & 0 deletions binding/android/RhinoTestApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches/build_file_checksums.ser
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/rhino/build
/captures
.externalNativeBuild

*.jks
!.dummy.jks
32 changes: 32 additions & 0 deletions binding/android/RhinoTestApp/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
defaultTargetSdkVersion = 31
}

buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
}
}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}

repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LIB_DIR=../../../lib
RESOURCE_DIR=../../../resources
ASSET_DIR=./rhino-activity-demo-app/src/androidTest/assets/test_resources
ASSET_DIR=./rhino-test-app/src/androidTest/assets/test_resources

if [ ! -d "${ASSET_DIR}/audio_samples" ]
then
Expand Down
17 changes: 17 additions & 0 deletions binding/android/RhinoTestApp/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true


Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Fri Nov 27 07:02:37 PST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
Loading

0 comments on commit 99155ff

Please sign in to comment.