-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(compose): add compose SDK * feat(compose): add UI tests and move common plugins to gradle/shared/code-quality.gradle * ci: do compilation test with compile-api=34 * ci: run test-minified after test-ui * chore: move compose example activity to separate module and rename compose->compose-sdk * chore: make sdk as transitive dependency for compose-sdk * ci: migrate to arm64 emulator * ci: switch to ubuntu-runner beause macos-latest arm64 broken * ci: enable KVM group permissions for emulator run * ci: parallel should be preinstalled on ubuntu runner * ci: downgrade emulator api to 28 to check if it affect stability * chore: move avd creation/run into separate action * ci: use recent avd for benchmark tests * chore: rename compose-app -> example-compose-app * ci: upload bencmark logs on failure * chore: replace DisposableEffect with Dialog+AndroidView * chore: add loading indicator to example-compose-app * test: bench on 28 emulator * ci: move back to macos-13 for benchmarking job * chore: move compose UI tests to test module * fix: put back compose-sdk/src/test directory * fix: compose tests for releaseAndroidTests variant * ci: fix avd cache key to respect runner os * chore: upgrade buildscript deps * ci: fix deprecation warning for gradle/gradle-build-action * chore: upload test/build for investigation * fix: inferredKeepRules.pro lookup in test module * chore: remove developers section from MavenPublication * ci: uninstall com.hcaptcha.sdk.bench.test before benchTest
- Loading branch information
Showing
50 changed files
with
1,067 additions
and
294 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: android-emulator-run | ||
description: Do run script after emulator boot (use cached AVD or create a new one) | ||
|
||
inputs: | ||
script: | ||
description: Script to run after emulator booted | ||
required: true | ||
arch: | ||
description: Emulator arch, supported values depends on runner | ||
required: true | ||
default: x86_64 | ||
target: | ||
description: Emulator target. Supported `default` or `google_apis` values | ||
required: true | ||
default: default | ||
profile: | ||
description: Emulator profile | ||
required: true | ||
default: Nexus 6 | ||
api-level: | ||
description: Emulator API level | ||
required: true | ||
default: '28' | ||
boot-options: | ||
description: Emulator boot options | ||
required: true | ||
default: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache AVD | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-api-${{ runner.os }}-${{ inputs.api-level }}-target-${{ inputs.target }} | ||
- if: runner.os == 'Linux' | ||
name: Enable KVM group perms | ||
shell: bash | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: 'Create AVD' | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
arch: ${{ inputs.arch }} | ||
target: ${{ inputs.target }} | ||
profile: ${{ inputs.profile }} | ||
api-level: ${{ inputs.api-level }} | ||
emulator-options: ${{ inputs.boot-options }} | ||
force-avd-creation: false | ||
disable-animations: false | ||
script: echo "Generated AVD snapshot for caching." | ||
- uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
arch: ${{ inputs.arch }} | ||
target: ${{ inputs.target }} | ||
profile: ${{ inputs.profile }} | ||
api-level: ${{ inputs.api-level }} | ||
emulator-options: ${{ inputs.boot-options }} | ||
force-avd-creation: false | ||
disable-animations: true | ||
script: ${{ inputs.script }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- name: 'Build' | ||
|
@@ -41,7 +41,7 @@ jobs: | |
|
||
build-matrix: | ||
name: 'Build (target:${{ matrix.target }} compile:${{ matrix.compile }} appcompat: ${{ matrix.appcompat }})' | ||
needs: [ test ] | ||
needs: test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
@@ -50,16 +50,16 @@ jobs: | |
- compile: 34 | ||
target: 34 | ||
appcompat: 1.6.1 | ||
- compile: 33 | ||
- compile: 34 | ||
target: 33 | ||
appcompat: 1.5.1 | ||
- compile: 32 | ||
- compile: 34 | ||
target: 32 | ||
appcompat: 1.4.2 | ||
- compile: 32 | ||
- compile: 34 | ||
target: 30 | ||
appcompat: 1.3.1 | ||
- compile: 30 | ||
- compile: 34 | ||
target: 30 | ||
appcompat: 1.3.1 | ||
steps: | ||
|
@@ -68,7 +68,7 @@ jobs: | |
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- run: | | ||
|
@@ -78,55 +78,22 @@ jobs: | |
test-ui: | ||
name: 'Test UI' | ||
runs-on: macos-latest | ||
needs: test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
api-level: [29] | ||
target: [default] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- name: 'Cache AVD' | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-api-${{ matrix.api-level }}-target-${{ matrix.target }} | ||
- name: 'Create AVD' | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/[email protected] | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: false | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: echo "Generated AVD snapshot for caching." | ||
- name: 'Tests' | ||
uses: reactivecircus/[email protected] | ||
- name: Run tests | ||
uses: ./.github/actions/android-emulator-run | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: true | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: | | ||
brew install parallel | ||
parallel --retries 3 ::: "./gradlew test:connectedCheck" | ||
script: "parallel --retries 3 ::: './gradlew test:connectedCheck'" | ||
- if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -137,55 +104,22 @@ jobs: | |
test-minified: | ||
name: 'Test UI Minified' | ||
runs-on: macos-latest | ||
needs: [ test-ui ] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
api-level: [29] | ||
target: [default] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- name: 'Cache AVD' | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-api-${{ matrix.api-level }}-target-${{ matrix.target }} | ||
- name: 'Create AVD' | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/[email protected] | ||
- name: Run tests | ||
uses: ./.github/actions/android-emulator-run | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: false | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: echo "Generated AVD snapshot for caching." | ||
- name: 'Tests' | ||
uses: reactivecircus/[email protected] | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: true | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: | | ||
brew install parallel | ||
parallel --retries 3 ::: "./gradlew test:connectedCheck -P testingMinimizedBuild=true -P android.enableR8.fullMode=false" | ||
script: "parallel --retries 3 ::: './gradlew test:connectedCheck -P testingMinimizedBuild=true -P android.enableR8.fullMode=false'" | ||
- if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -196,52 +130,34 @@ jobs: | |
test-benchmark: | ||
name: 'Test Benchmark' | ||
runs-on: macos-latest | ||
needs: test | ||
# ubuntu-latest fails with JNI ERROR (app bug): weak global reference table overflow (max=51200) | ||
# macos-latest i.e. macos-14 https://github.com/ReactiveCircus/android-emulator-runner/issues/324 | ||
runs-on: macos-13 | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
api-level: [29] | ||
target: [default] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- name: 'Cache AVD' | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-api-${{ matrix.api-level }}-target-${{ matrix.target }} | ||
- name: 'Create AVD' | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
uses: reactivecircus/[email protected] | ||
- name: Run tests | ||
uses: ./.github/actions/android-emulator-run | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: false | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: echo "Generated AVD snapshot for caching." | ||
- uses: reactivecircus/[email protected] | ||
api-level: 29 | ||
script: | | ||
adb uninstall com.hcaptcha.sdk.bench.test || true | ||
./gradlew benchmark:connectedReleaseAndroidTest | ||
- if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
force-avd-creation: false | ||
disable-animations: true | ||
arch: x86_64 | ||
profile: Nexus 6 | ||
script: ./gradlew benchmark:connectedReleaseAndroidTest | ||
name: androidTest-benchmark-results | ||
path: | | ||
benchmark/build/outputs/androidTest-results | ||
benchmark/build/reports/androidTests | ||
- name: Diff benchmark result | ||
id: diff-benchmark | ||
uses: ./.github/actions/android-benchmark-diff | ||
|
@@ -284,7 +200,7 @@ jobs: | |
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- uses: actions/cache@v4 | ||
|
@@ -310,7 +226,7 @@ jobs: | |
with: | ||
java-version: ${{ env.JAVA_VERSION }} | ||
distribution: adopt | ||
- uses: gradle/gradle-build-action@v3 | ||
- uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: false | ||
- name: 'Build' | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
/sdk/gradle.properties | ||
/.idea | ||
.DS_Store | ||
/build | ||
build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,6 @@ public void onLoaded() { | |
latch.countDown(); | ||
} | ||
}, | ||
new TestHCaptchaStateListener(), | ||
webView | ||
); | ||
}); | ||
|
Oops, something went wrong.