Skip to content

Commit

Permalink
libs
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Mar 11, 2024
1 parent a232e7a commit 61fc61f
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 43 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body:
attributes:
label: SDK
options:
- Android
- C
- Python
- Web
Expand Down
128 changes: 128 additions & 0 deletions .github/workflows/android-appcenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Android AppCenter Tests

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

defaults:
run:
working-directory: binding/android/FalconTestApp

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

steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3

- 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: Build app
run: ./gradlew assembleDebug

- name: Build androidTest
run: ./gradlew assembleDebugAndroidTest

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Falcon-Android"
--devices "Picovoice/android-min-max"
--app-path falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk
--test-series "falcon-android"
--locale "en_US"
--build-dir falcon-test-app/build/outputs/apk/androidTest/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 assembleRelease

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

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Falcon-Android"
--devices "Picovoice/android-min-max"
--app-path falcon-test-app/build/outputs/apk/release/falcon-test-app-release.apk
--test-series "falcon-android"
--locale "en_US"
--build-dir falcon-test-app/build/outputs/apk/androidTest/release
35 changes: 35 additions & 0 deletions .github/workflows/android-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Android Demos

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- '.github/workflows/android-demos.yml'
- 'demo/android/**'
- '!demo/android/FalconDemo/README.md'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- '.github/workflows/android-demos.yml'
- 'demo/android/**'
- '!demo/android/FalconDemo/README.md'

jobs:
build-falcon-demo:
runs-on: ubuntu-latest
defaults:
run:
working-directory: demo/android/FalconDemo

steps:
- uses: actions/checkout@v3

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

- name: Build
run: ./gradlew assembleDebug
90 changes: 90 additions & 0 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Android Performance

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'lib/android/**'
- 'lib/common/**'
- '.github/workflows/android-perf.yml'
pull_request:
branches: [ main, 'v[0-9]+.[0-9]+' ]
paths:
- 'lib/android/**'
- 'lib/common/**'
- '.github/workflows/android-perf.yml'

defaults:
run:
working-directory: binding/android/FalconTestApp

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

strategy:
matrix:
device: [single-android, 32bit-android]
include:
- device: single-android
procPerformanceThresholdSec: 1.0
- device: 32bit-android
procPerformanceThresholdSec: 1.0

steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3

- 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: Inject Number of Iterations
run: echo numTestIterations="20" >> local.properties

- name: Inject Proc Performance Threshold
run: echo procPerformanceThresholdSec="${{ matrix.procPerformanceThresholdSec }}" >> local.properties

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

- name: Build app
run: ./gradlew assembleDebug

- name: Build androidTest
run: ./gradlew assembleDebugAndroidTest

- name: Run tests on AppCenter
run: appcenter test run espresso
--token ${{secrets.APPCENTERAPITOKEN}}
--app "Picovoice/Falcon-Android"
--devices "Picovoice/${{ matrix.device }}"
--app-path falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk
--test-series "falcon-android"
--locale "en_US"
--build-dir falcon-test-app/build/outputs/apk/androidTest/debug
9 changes: 4 additions & 5 deletions binding/android/Falcon/falcon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ android {
}

buildTypes {
// TODO: update post-jni
// release {
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// }
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
28 changes: 13 additions & 15 deletions binding/android/FalconTestApp/falcon-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,23 @@ android {
}

signingConfigs {
// TODO: update post-jni
// release {
// storePassword properties.getProperty("storePassword")
// storeFile file(properties.getProperty("storeFile", ".dummy.jks"))
// keyAlias properties.getProperty("keyAlias")
// keyPassword properties.getProperty("keyPassword")
// }
release {
storePassword properties.getProperty("storePassword")
storeFile file(properties.getProperty("storeFile", ".dummy.jks"))
keyAlias properties.getProperty("keyAlias")
keyPassword properties.getProperty("keyPassword")
}
}

buildTypes {
// TODO: update post-jni
debug {
// signingConfig signingConfigs.release
signingConfig signingConfigs.release
}
// release {
// minifyEnabled false
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
// }
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

if (System.getProperty("testBuildType", "debug") == "integ") {
Expand Down Expand Up @@ -133,4 +131,4 @@ afterEvaluate {
tasks."mergeReleaseAssets".dependsOn "copyParams"
tasks."mergeDebugAssets".dependsOn "copyAudio"
tasks."mergeReleaseAssets".dependsOn "copyAudio"
}
}
Loading

0 comments on commit 61fc61f

Please sign in to comment.