build(android): preliminary Android support for algokit_transact #5
Workflow file for this run
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: Android CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| android: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.85.0 | |
| targets: aarch64-linux-android, arm-linux-androideabi, armv7-linux-androideabi, i686-linux-android, thumbv7neon-linux-androideabi, x86_64-linux-android | |
| - name: Install Cargo-NDK | |
| run: cargo install cargo-ndk@^3.5 | |
| - name: Install Android ndk | |
| uses: nttld/setup-ndk@v1 | |
| with: | |
| ndk-version: r27d | |
| - name: Build AAR | |
| run: cargo pkg transact aar | |
| - name: Verify test resources | |
| working-directory: packages/android/algokit_transact | |
| run: | | |
| echo "Checking for test resources..." | |
| ls -la src/test/resources/ || echo "No test resources directory found" | |
| if [ -f src/test/resources/libalgokit_transact_ffi.so ]; then | |
| echo "✓ Host library found for unit tests" | |
| file src/test/resources/libalgokit_transact_ffi.so | |
| else | |
| echo "✗ Host library NOT found - unit tests will fail" | |
| exit 1 | |
| fi | |
| - name: Test | |
| working-directory: packages/android/algokit_transact | |
| run: ./gradlew test | |
| - name: Archive Build Output | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| with: | |
| name: algokit_transact.aar | |
| path: packages/android/algokit_transact/build/outputs/aar/algokit_transact-release.aar |