Skip to content

Commit

Permalink
run instrumented tests after build.
Browse files Browse the repository at this point in the history
I still have no idea why it started working locally on my machine, but
so far we should enable it on CI builds and see if it works.

related issue: #85
  • Loading branch information
atsushieno committed Feb 2, 2022
1 parent 9744c49 commit 2c63179
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ jobs:
with:
path: /usr/local/lib/android/sdk/ndk/21.3.6528147
key: ndk_r21d_linux
- name: cache AVD
uses: actions/cache@v2
env:
cache-name: cache-avd
with:
path: /home/runner/.android/gradle/avd
key: gradle-avd
- name: apt install
run: |
echo y | sudo apt-get install doxygen libxml2-dev libgrpc++-dev libgrpc-dev libprotobuf-dev protobuf-compiler protobuf-compiler-grpc graphviz cmake ninja-build
- name: stupid NDK setup workaround for GitHub Actions
run: sudo mkdir -p /usr/local/lib/android/sdk/ndk && sudo chmod 777 /usr/local/lib/android/sdk/ndk
- name: build
run: make
- name: run instrumented tests
run: cd java && ./gradlew testDevice1DebugAndroidTest
- name: upload artifact
if: success()
uses: actions/upload-artifact@v2
Expand Down
5 changes: 3 additions & 2 deletions java/androidaudioplugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ android {
}
*/

// I leave these settings here for possible use in the future (because this existence is harmless,
// but note that it never worked for me: https://github.com/atsushieno/android-audio-plugin-framework/issues/85
// FIXME: it is annoying to copy this everywhere, but build.gradle.kts is incapable of importing this fragment...
// It's been long time until I got this working, and I have no idea why it started working.
// If you don't get this working, you are not alone: https://github.com/atsushieno/android-audio-plugin-framework/issues/85
testOptions {
devices {
this.register<com.android.build.api.dsl.ManagedVirtualDevice>("testDevice1") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

package org.androidaudioplugin

import org.junit.Assert.assertTrue
import org.junit.Test

class NativeTest {
@Test
fun test1() {
// FIXME: implement actual tests here.
assertTrue("test", true)
}
}

14 changes: 14 additions & 0 deletions java/samples/aaphostsample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ android {
aaptOptions {
noCompress ("sample.wav")
}

// FIXME: it is annoying to copy this everywhere, but build.gradle.kts is incapable of importing this fragment...
// It's been long time until I got this working, and I have no idea why it started working.
// If you don't get this working, you are not alone: https://github.com/atsushieno/android-audio-plugin-framework/issues/85
testOptions {
devices {
this.register<com.android.build.api.dsl.ManagedVirtualDevice>("testDevice1") {
device = "Pixel 5"
apiLevel = 30
systemImageSource = "google"
abi = "x86"
}
}
}
}

dependencies {
Expand Down

0 comments on commit 2c63179

Please sign in to comment.