Skip to content

feat(kmp/ed25519): in-place KMP module (JNI on Android, cinterop on iOS) + mnemonic Kotlin rewrite #1574

feat(kmp/ed25519): in-place KMP module (JNI on Android, cinterop on iOS) + mnemonic Kotlin rewrite

feat(kmp/ed25519): in-place KMP module (JNI on Android, cinterop on iOS) + mnemonic Kotlin rewrite #1574

Workflow file for this run

name: CI
on:
pull_request:
concurrency:
# Limit concurrency to 1 for PRs. 'main' concurrency isn't limited.
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CI: true
JAVA_VERSION: 17
jobs:
compile-check:
name: Compile check (no creds required)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Java env
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'
cache: 'gradle'
- name: Gradle build cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-1
.gradle/configuration-cache
key: gradle-build-cache-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
restore-keys: |
gradle-build-cache-
# The build's convention plugins read keys from local.properties and fail if the
# file is absent. Compile-only needs no real secrets, so write a dummy file with
# sdk.dir + blank keys. (The flipcash-tests job gets this implicitly via its secret steps.)
- name: Create dummy local.properties (compile-only, no secrets)
run: |
echo "sdk.dir=$ANDROID_HOME" > local.properties
echo 'BUGSNAG_API_KEY=""' >> local.properties
echo 'GOOGLE_CLOUD_PROJECT_NUMBER=0' >> local.properties
echo 'MIXPANEL_API_KEY=""' >> local.properties
echo 'COINBASE_ONRAMP_API_KEY=' >> local.properties
# compileDebugSources transitively runs processDebugGoogleServices (R generation
# consumes its generated resources), which needs a google-services.json. Compile-only
# needs no real Firebase project, so write a dummy matching the applicationId.
- name: Create dummy google-services.json (compile-only, no secrets)
run: |
mkdir -p apps/flipcash/app/src
echo '{"project_info":{"project_number":"000000000000","project_id":"flipcash-ci-dummy","storage_bucket":"flipcash-ci-dummy.appspot.com"},"client":[{"client_info":{"mobilesdk_app_id":"1:000000000000:android:0000000000000000000000","android_client_info":{"package_name":"com.flipcash.app.android"}},"oauth_client":[],"api_key":[{"current_key":"AIzaSyDUMMYDUMMYDUMMYDUMMYDUMMYDUMMYDUM"}],"services":{"appinvite_service":{"other_platform_oauth_client":[]}}}],"configuration_version":"1"}' > apps/flipcash/app/src/google-services.json
# This catches KMP interop regressions (missing @JvmStatic, internal visibility
# leaking across modules) that only surface when consumers compile against the
# shared library. processDebugGoogleServices runs but is satisfied by the dummy above.
- name: Compile app sources
run: ./gradlew :apps:flipcash:app:compileDebugSources --continue --no-daemon
flipcash-tests:
name: Run Flipcash Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Java env
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'
cache: 'gradle'
- name: Gradle build cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-1
.gradle/configuration-cache
key: gradle-build-cache-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
restore-keys: |
gradle-build-cache-
- name: Setup Ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
- name: Decode Google Services JSON file
uses: timheuer/base64-to-file@v1
id: google_services_json_file
with:
fileName: google-services.json
fileDir: ./apps/flipcash/app/src
encodedString: ${{ secrets.FLIPCASH2_GOOGLE_SERVICES }}
- name: Setup BugSnag API Key
run: echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}\" > ./local.properties
- name: Setup Google Cloud Project Number
run: echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties
- name: Setup Mixpanel API Key
run: echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
- name: Setup Coinbase OnRamp API Key
run: echo COINBASE_ONRAMP_API_KEY=${{ secrets.COINBASE_ONRAMP_API_KEY }} >> ./local.properties
- name: Run Flipcash tests
run: bundle exec fastlane android flipcash_tests
env:
SKIP_COVERAGE: "true"
# TODO(cross-platform-vectors): wire instrumented vector tests once this CI has emulator support.
#
# Three androidTest suites require a device/emulator (JNI or Android-framework deps):
# - :libs:encryption:ed25519 connectedAndroidTest (JNI + android.util.Base64)
# - :libs:encryption:mnemonic connectedAndroidTest (wordlist in res/raw + JNI ed25519)
# - :libs:currency-math connectedAndroidTest (loads .bin tables from assets)
#
# To add: create a new job (e.g. `vector-instrumented-tests`) with:
# runs-on: ubuntu-latest # or macos-latest (faster KVM on Linux)
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-java@v3 (java-version: '21', distribution: 'corretto')
# - uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 35 # matches compileSdk in build-logic convention plugins
# arch: x86_64
# script: >
# ./gradlew
# :libs:encryption:ed25519:connectedAndroidTest
# :libs:encryption:mnemonic:connectedAndroidTest
# :libs:currency-math:connectedAndroidTest
# --no-daemon
#
# The host-JVM vector suites (base58, solana_message, compact_message) are already covered by
# the flipcash-tests job above via `flipcashTestDebug` → :libs:encryption:base58 and
# :services:opencode are now in unitTestPaths (see settings.gradle.kts).