Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
- created
schedule:
# Every Monday at 00:30 UTC
- cron: '30 0 * * 1'
- cron: "30 0 * * 1"

env:
JAVA_VERSION: '21'
JAVA_DISTRIBUTION: 'microsoft'
JAVA_VERSION: "21"
JAVA_DISTRIBUTION: "microsoft"

jobs:
test:
Expand Down Expand Up @@ -94,11 +94,11 @@ jobs:
strategy:
fail-fast: false
matrix:
emulator: [
# { api-level: 23, target: google_apis },
# It seems that Google no longer provides this image? Let's temporarily disable it.
{ api-level: 34, target: playstore }
]
emulator:
[
{ api-level: 23, target: google_apis },
{ api-level: 34, target: playstore },
]
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -124,11 +124,10 @@ jobs:
target: ${{ matrix.emulator.target }}
script: ./gradlew connectedCheck
arch: x86_64
profile: 'pixel_2'

profile: "pixel_2"

deploy-gh-releases:
needs: [ build, javadoc, android-test ]
needs: [build, javadoc, android-test]
permissions:
contents: write
if: github.event_name == 'release' && github.event.action == 'created'
Expand Down Expand Up @@ -160,7 +159,7 @@ jobs:
folder: javadoc

deploy-maven-central:
needs: [ build, javadoc, android-test ]
needs: [build, javadoc, android-test]
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
env:
Expand All @@ -178,4 +177,4 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Publish to Maven Central
run: ./gradlew publishAggregationToCentralPortal
run: ./gradlew publishAggregationToCentralPortal
Binary file added android_test/app/libs/stellar-sdk-2.0.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,29 @@ fun MainPreview() {

private fun testSDK(): String {
return try {
// send request to horizon server
val server = Server("https://horizon.stellar.org")
val horizonResp = server.root().execute()
if (horizonResp == null || horizonResp.networkPassphrase != Network.PUBLIC.networkPassphrase) {
throw Exception("Query Horizon failed")
}

// send request to Soroban RPC server
val sorobanServer = SorobanServer("https://soroban-testnet.stellar.org:443")
if (sorobanServer.network.passphrase != Network.TESTNET.networkPassphrase) {
throw Exception("Query Soroban Server failed")
}

// Test Federation
// Not enabled if Android SDK version is less than 26,
// see https://stackoverflow.com/questions/64844311/certpathvalidatorexception-connecting-to-a-lets-encrypt-host-on-android-m-or-ea
if (Build.VERSION.SDK_INT >= 26) {
// send request to horizon server
val server = Server("https://horizon.stellar.org")
val horizonResp = server.root().execute()
if (horizonResp == null || horizonResp.networkPassphrase != Network.PUBLIC.networkPassphrase) {
throw Exception("Query Horizon failed")
}

// send request to Soroban RPC server
val sorobanServer = SorobanServer("https://soroban-testnet.stellar.org:443")
if (sorobanServer.network.passphrase != Network.TESTNET.networkPassphrase) {
throw Exception("Query Soroban Server failed")
}

val xdr =
server.transactions().limit(1).includeFailed(false).execute().records.get(0).envelopeXdr
val tx: Transaction = Transaction.fromEnvelopeXdr(xdr, Network.PUBLIC) as Transaction
val resp = server.submitTransaction(tx)
Log.d("MainActivity", "testSDK resp: $resp")

// Test Federation
val fedResp = Federation().resolveAddress("example*lobstr.co")
if (fedResp == null || fedResp.accountId == null) {
throw Exception("Query Federation failed")
Expand Down Expand Up @@ -280,14 +286,6 @@ private fun testSDK(): String {
.rootInvocation(invocation)
.build()
Auth.authorizeEntry(entry.toXdrBase64(), signer, validUntilLedgerSeq, network)

// send real transaction
// https://horizon.stellar.org/transactions/fe833c504ca8b329c1e00adec7da79f61a55e28dc705e22a6515494427cc456a
val xdr =
server.transactions().limit(1).includeFailed(false).execute().records.get(0).envelopeXdr
val tx: Transaction = Transaction.fromEnvelopeXdr(xdr, Network.PUBLIC) as Transaction
val resp = server.submitTransaction(tx)
Log.d("MainActivity", "testSDK resp: $resp")
"SUCCESS"
} catch (e: Exception) {
Log.e("MainActivity", "testSDK ERROR", e)
Expand Down