Merge pull request #577 from gini/PP-548_Increase_buttons_size #1813
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
name: Check Capture SDK | |
on: | |
push: | |
paths: | |
- 'capture-sdk/**' | |
- 'bank-api-library/**' | |
- 'core-api-library/**' | |
- 'gradle/**' | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
pull_request: | |
types: [opened, edited, reopened] | |
paths: | |
- 'capture-sdk/**' | |
- 'bank-api-library/**' | |
- 'core-api-library/**' | |
- 'gradle/**' | |
workflow_call: | |
secrets: | |
GINI_MOBILE_TEST_CLIENT_SECRET: | |
required: true | |
CAPTURE_SDK_EXAMPLE_APP_KEYSTORE_PASSWORD: | |
required: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run unit tests | |
run: ./gradlew capture-sdk:sdk:testDebugUnitTest | |
- name: archive unit test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-unit-test-results | |
path: capture-sdk/sdk/build/reports/tests | |
# should be investigated later, right now does not work with AGP 8 | |
# read this article for some help: https://about.codecov.io/blog/code-coverage-for-android-development-using-kotlin-jacoco-github-actions-and-codecov/ | |
# | |
# - name: create unit test coverage report | |
# run: ./gradlew capture-sdk:sdk:jacocoTestDebugUnitTestReport | |
# | |
# - name: archive unit test coverage report | |
# if: always() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: capture-sdk-unit-test-coverage | |
# path: capture-sdk/sdk/build/jacoco/jacocoHtml | |
instrumented-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup java | |
uses: actions/setup-java@v4 | |
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 none | |
disable-animations: true | |
script: echo "Generated AVD snapshot for caching." | |
- name: run 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.capture.test ; | |
./gradlew capture-sdk:sdk:connectedCheck | |
- name: archive instrumented test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-instrumented-test-results | |
path: capture-sdk/sdk/build/outputs/androidTest-results/connected | |
default-network-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run unit tests | |
run: ./gradlew capture-sdk:default-network:testDebugUnitTest | |
- name: archive unit test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-default-network-unit-test-results | |
path: capture-sdk/default-network/build/reports/tests | |
# should be investigated later, right now does not work with AGP 8 | |
# read this article for some help: https://about.codecov.io/blog/code-coverage-for-android-development-using-kotlin-jacoco-github-actions-and-codecov/ | |
# | |
# - name: create unit test coverage report | |
# run: ./gradlew capture-sdk:default-network:jacocoTestDebugUnitTestReport | |
# | |
# - name: archive unit test coverage report | |
# if: always() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: capture-sdk-default-network-unit-test-coverage | |
# path: capture-sdk/default-network/build/jacoco/jacocoHtml | |
default-network-instrumented-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup java | |
uses: actions/setup-java@v4 | |
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-31-${{ 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: 31 | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -no-audio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: echo "Generated AVD snapshot for caching." | |
- name: run instrumented tests | |
timeout-minutes: 20 | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
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.capture.network.test ; | |
./gradlew capture-sdk:default-network:connectedCheck | |
-PtestClientId="gini-mobile-test" | |
-PtestClientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}" | |
-PtestApiUri="https://pay-api.gini.net" | |
-PtestUserCenterUri="https://user.gini.net" | |
- name: archive instrumented test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-default-network-instrumented-test-results | |
path: capture-sdk/default-network/build/outputs/androidTest-results/connected | |
checkstyle: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run checkstyle | |
run: ./gradlew capture-sdk:sdk:checkstyle | |
- name: archive checkstyle report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-checkstyle-report | |
path: capture-sdk/sdk/build/reports/checkstyle/*.html | |
pmd: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run pmd | |
run: ./gradlew capture-sdk:sdk:pmd | |
- name: archive pmd report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-pmd-report | |
path: capture-sdk/sdk/build/reports/pmd/*.html | |
android-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run android lint | |
run: ./gradlew capture-sdk:sdk:lint | |
- name: archive android lint report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-android-lint-report | |
path: capture-sdk/sdk/build/reports/lint-results*.html | |
detekt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run detekt | |
run: ./gradlew capture-sdk:sdk:detekt | |
- name: archive detekt report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-detekt-report | |
path: capture-sdk/sdk/build/reports/detekt/*.html | |
ktlint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- name: run ktlint | |
run: ./gradlew capture-sdk:sdk:ktlintCheck | |
- name: archive ktlint report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capture-sdk-ktlint-report | |
path: capture-sdk/sdk/build/reports/ktlint/**/*.html |