Kotlin SDK nightly testnet tests #64
This file contains hidden or 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: Kotlin SDK nightly testnet tests | |
| on: | |
| schedule: | |
| # 03:15 UTC daily — off-peak for the shared runners. | |
| - cron: '15 3 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| testnet-integration: | |
| name: Testnet integration (API 35 emulator) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v4.1-dev | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android/sdk/ndk /opt/ghc | |
| df -h / | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| packages: >- | |
| platforms;android-35 | |
| build-tools;35.0.0 | |
| ndk;28.1.13356709 | |
| platform-tools | |
| - name: Set up Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-linux-android | |
| - name: Restore cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: kotlin-sdk-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| kotlin-sdk-cargo- | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk --locked | |
| - name: Install protoc v32.0 (repo-standard; apt's 3.21 breaks tenderdash-proto) | |
| run: | | |
| curl -fsSL -o /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v32.0/protoc-32.0-linux-x86_64.zip | |
| sudo unzip -o /tmp/protoc.zip -d /usr/local 'bin/protoc' 'include/*' | |
| protoc --version | |
| - name: Build native library (x86_64, dev profile) | |
| working-directory: packages/kotlin-sdk | |
| env: | |
| ANDROID_NDK_HOME: ${{ env.ANDROID_SDK_ROOT }}/ndk/28.1.13356709 | |
| run: ./build_android.sh --abi x86_64 --profile dev --verify | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Enable KVM 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: Run testnet-tagged instrumented tests | |
| uses: reactivecircus/android-emulator-runner@v2 | |
| with: | |
| api-level: 35 | |
| arch: x86_64 | |
| profile: pixel_6 | |
| disable-animations: true | |
| emulator-options: -no-snapshot -no-window -no-audio -no-boot-anim -camera-back none -dns-server 8.8.8.8,1.1.1.1 | |
| working-directory: packages/kotlin-sdk | |
| # -Ptestnet=true lifts the TestnetGuard so the live-network | |
| # queries (identity fetch, DPNS resolve, contract fetch) run. | |
| script: ./gradlew :sdk:connectedDebugAndroidTest -Ptestnet=true --stacktrace | |
| - name: Upload reports on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kotlin-sdk-nightly-reports | |
| path: | | |
| packages/kotlin-sdk/sdk/build/reports | |
| packages/kotlin-sdk/sdk/build/outputs/androidTest-results |