From 2d7df389ed70083a1f1cf44f3e861c07bc06c7e3 Mon Sep 17 00:00:00 2001 From: Alpar Szotyori Date: Mon, 8 Jul 2024 16:07:32 +0200 Subject: [PATCH] ci(bank-sdk): Create dedicated workflow for running UI tests PM-89 --- .github/workflows/bank-sdk.check.ui-tests.yml | 88 +++++++++++++++++++ .github/workflows/bank-sdk.check.yml | 15 ---- 2 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/bank-sdk.check.ui-tests.yml diff --git a/.github/workflows/bank-sdk.check.ui-tests.yml b/.github/workflows/bank-sdk.check.ui-tests.yml new file mode 100644 index 0000000000..03e35da7a2 --- /dev/null +++ b/.github/workflows/bank-sdk.check.ui-tests.yml @@ -0,0 +1,88 @@ +name: Check Bank SDK - UI Tests + +on: + push: + paths: + - 'bank-sdk/**' + - 'capture-sdk/**' + - 'bank-api-library/**' + - 'core-api-library/**' + - 'gradle/**' + branches: + - '**' + tags-ignore: + - '**' + pull_request: + types: [opened, edited, reopened] + paths: + - 'bank-sdk/**' + - 'capture-sdk/**' + - 'bank-api-library/**' + - 'core-api-library/**' + - 'gradle/**' + workflow_call: + secrets: + GINI_MOBILE_TEST_CLIENT_SECRET: + required: true + +jobs: + ui-tests: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: setup java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: 'gradle' + + - name: enable KVM group perms for emulator + 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: avd cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-x86_64-33-${{ github.ref_name }} + + - name: create avd and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 33 + arch: x86_64 + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -no-audio -no-boot-anim -camera-back emulated + disable-animations: true + script: echo "Generated AVD snapshot for caching." + + - name: run example app instrumented tests + timeout-minutes: 20 + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 33 + arch: x86_64 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: > + adb uninstall net.gini.android.bank.sdk.exampleapp.test ; + ./gradlew bank-sdk:example-app:connectedDevExampleAppDebugAndroidTest + -PclientId="gini-mobile-test" + -PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" + + - name: archive instrumented test results + if: always() + uses: actions/upload-artifact@v3 + with: + name: bank-sdk-example-app-instrumented-test-results + path: bank-sdk/example-app/build/outputs/androidTest-results/connected diff --git a/.github/workflows/bank-sdk.check.yml b/.github/workflows/bank-sdk.check.yml index f43e54d822..bbf8270b2e 100644 --- a/.github/workflows/bank-sdk.check.yml +++ b/.github/workflows/bank-sdk.check.yml @@ -126,21 +126,6 @@ jobs: name: bank-sdk-instrumented-test-results path: bank-sdk/sdk/build/outputs/androidTest-results/connected - - name: run example app instrumented tests - timeout-minutes: 20 - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 33 - arch: x86_64 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - script: > - adb uninstall net.gini.android.bank.sdk.exampleapp.test ; - ./gradlew bank-sdk:example-app:connectedDevExampleAppDebugAndroidTest - -PclientId="gini-mobile-test" - -PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" - - name: archive instrumented test results if: always() uses: actions/upload-artifact@v3