Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Actions/CI]: Switch to macos-latest-xlarge CI runner for Android, iOS pipelines #3474

Merged
merged 60 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c1d5126
[Android/iOS]: Use macos-latest-xlarge CI runner
satoshiotomakan Oct 9, 2023
6a16162
[Android/Kotlin]: Add a step to setup Android SDK
satoshiotomakan Oct 9, 2023
4250ae1
[Android/Kotlin]: Add `android-sdk` script
satoshiotomakan Oct 9, 2023
dab61d4
[Android/Kotlin]: Export `BOOST_ROOT`
satoshiotomakan Oct 10, 2023
7f25688
[Android/Kotlin]: Fix Android, Kotlin, Kotlin Multiplatform CI
satoshiotomakan Oct 10, 2023
9aff416
[Android/Kotlin]: Use arm64-v8a arch for Android tests
satoshiotomakan Oct 10, 2023
380c562
[Android/Kotlin]: Try to use `amyu/setup-android@v3` package
satoshiotomakan Oct 10, 2023
419cdec
[Android/Kotlin]: Install android-33 arm64-v8a
satoshiotomakan Oct 10, 2023
742ce44
[Android/Kotlin]: WIP
satoshiotomakan Oct 10, 2023
40e3d29
[Android/Kotlin]: Try amyu/setup-android@v3 package that probably fix…
satoshiotomakan Oct 10, 2023
c6d90bd
[Android/Kotlin]: Try to downgrade MacOS from latest to 12
satoshiotomakan Oct 10, 2023
bbacf69
[Android CI]: Try to use `reactivecircus/android-emulator-runner@v2`
satoshiotomakan Oct 19, 2023
bea8a82
Merge branch 'master' into s/use-gh-hosted-runners
satoshiotomakan Oct 19, 2023
e486bae
[Android CI]: Try to use reactivecircus/android-emulator-runner@v2 only
satoshiotomakan Oct 19, 2023
1231d6f
[Android CI]: Disable `Setup Android SDK`
satoshiotomakan Oct 19, 2023
e6d1a7e
[CI]: Try to use ubuntu-latest for android-ci
satoshiotomakan Oct 23, 2023
de815b8
[CI]: Fix android-ci
satoshiotomakan Oct 23, 2023
abdd6ac
[CI]: Fix android-ci
satoshiotomakan Oct 23, 2023
78f7bc4
[CI]: Add a debug step to android-ci
satoshiotomakan Oct 23, 2023
0a5f71c
[CI]: Add debug messages to android-ci and ios-ci
satoshiotomakan Oct 23, 2023
a685aa5
[CI]: Add a debug step to android-ci
satoshiotomakan Oct 23, 2023
24de999
[CI]: Try to include Boost_INCLUDE_DIRS directly
satoshiotomakan Oct 23, 2023
9716700
[CI]: Add a debug step to android-ci
satoshiotomakan Oct 23, 2023
8f41f68
[CI]: Try a few more tricks
satoshiotomakan Oct 23, 2023
d16edb4
[CI]: Move back to macos-latest for android-ci
satoshiotomakan Oct 23, 2023
dc8c3fc
[CI]: Clear the internal dependencies cache
satoshiotomakan Oct 23, 2023
59a28e9
[CI]: Use `runner.arch` to separate internal cache
satoshiotomakan Oct 23, 2023
93d92e7
[CI]: Use x86 Android emulator
satoshiotomakan Oct 23, 2023
1dfc8cb
[CI]: Use x86_64
satoshiotomakan Oct 23, 2023
9387dee
[CI]: Use android-26,x86
satoshiotomakan Oct 23, 2023
b49e72b
[CI]: Revert temp changes
satoshiotomakan Oct 24, 2023
77fbe3b
Merge branch 'master' into s/use-gh-hosted-runners
satoshiotomakan Oct 24, 2023
62805bf
[CI]: Clear Linux internal cache, fix Rust coverage
satoshiotomakan Oct 24, 2023
16f80f1
[CI] Trigger CI #1
satoshiotomakan Oct 24, 2023
4799a93
[CI]: Try to remove boost::lexical_cast and use ubuntu-latest for And…
satoshiotomakan Oct 24, 2023
a553145
[CI]: Add emulator options
satoshiotomakan Oct 24, 2023
c4eddfc
[CI]: Disable snapshot
satoshiotomakan Oct 24, 2023
e3ddcb0
[CI]: Try to build boost for android manually
satoshiotomakan Oct 25, 2023
3c01490
[CI]: Add argument to install-dependencies
satoshiotomakan Oct 25, 2023
6267d26
[CI]: Fix android ndk path
satoshiotomakan Oct 25, 2023
48e1ab7
[CI]: Try to use reactivecircus/android-emulator-runner@v2
satoshiotomakan Oct 25, 2023
0b8331d
[CI]: Test changes
satoshiotomakan Oct 25, 2023
f6f51c2
[CI]: Fix android tests step
satoshiotomakan Oct 25, 2023
bba2efa
[CI]: Try to use api-level 33
satoshiotomakan Oct 25, 2023
8634118
[CI]: Try to use x86_64
satoshiotomakan Oct 25, 2023
c5b22a3
[CI]: Try to use api-30 x86
satoshiotomakan Oct 25, 2023
a9ef667
[CI]: Get back to android-test
satoshiotomakan Oct 25, 2023
01a041e
[CI]: Do not specify Android device
satoshiotomakan Oct 25, 2023
9a636fb
[Sec]: Install libpulse0
satoshiotomakan Oct 25, 2023
cbd1eb5
[CI]: Use macos-latest-large
satoshiotomakan Oct 26, 2023
844949b
[CI]: Set no-audio
satoshiotomakan Oct 26, 2023
37009fb
[CI]: Fix android-test
satoshiotomakan Oct 26, 2023
fea463a
[CI]: Fix android installation
satoshiotomakan Oct 26, 2023
157c443
[CI]: Try to use android-30 API
satoshiotomakan Oct 26, 2023
414108b
[CI]: Try finally using reactivecircus/android-emulator-runner@v2 one…
satoshiotomakan Oct 26, 2023
8766ae9
[CI] Trigger CI #2
satoshiotomakan Oct 26, 2023
8128881
Merge branch 'master' into s/use-gh-hosted-runners
Milerius Nov 13, 2023
a28281c
Merge branch 'master' into s/use-gh-hosted-runners
satoshiotomakan Nov 16, 2023
af1530e
[CI]: Revert unnecessary changes
satoshiotomakan Nov 16, 2023
81b5b37
[CI]: Fix Docker, KMP
satoshiotomakan Nov 16, 2023
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
30 changes: 26 additions & 4 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
build:
runs-on: [ self-hosted, macOS, ARM64, wallet-core ]
runs-on: macos-latest-large
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
Expand All @@ -29,6 +29,15 @@ jobs:
- name: Install system dependencies
run: |
tools/install-sys-dependencies-mac

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: |
rust

- name: Install Rust dependencies
run: |
tools/install-rust-dependencies

- name: Install Android Dependencies
Expand All @@ -39,7 +48,7 @@ jobs:
uses: actions/cache@v3
with:
path: build/local
key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }}
key: ${{ runner.os }}-${{ runner.arch }}-internal-${{ hashFiles('tools/install-dependencies') }}

- name: Install internal dependencies
run: tools/install-dependencies
Expand All @@ -51,8 +60,21 @@ jobs:
- name: Build Kotlin doc
run: tools/kotlin-doc

- name: Run test
run: tools/android-test
- name: Build tests
run: |
pushd android
./gradlew assembleAndroidTest
popd

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
target: google_apis
arch: x86
ndk: 23.1.7779620
cmake: 3.18.1
script: cd android; ./gradlew connectedAndroidTest

- name: Build sample app
run: tools/samples-build android
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,45 @@ concurrency:

jobs:
build:
runs-on: [ self-hosted, macOS, ARM64, wallet-core ]
runs-on: macos-latest-xlarge
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3

- name: Install system dependencies
run: |
tools/install-sys-dependencies-mac

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: |
rust

- name: Install Rust dependencies
run: |
tools/install-rust-dependencies

- name: Cache internal dependencies
id: internal_cache
uses: actions/cache@v3
with:
path: build/local
key: ${{ runner.os }}-internal-${{ hashFiles('tools/install-dependencies') }}

- name: Install internal dependencies
run: |
tools/install-dependencies
if: steps.internal_cache.outputs.cache-hit != 'true'

- name: Run codegen tests
run: tools/codegen-test

- name: Run iOS tests
run: |
tools/generate-files ios
tools/ios-test

- name: Build sample app
run: |
tools/samples-build ios
14 changes: 13 additions & 1 deletion .github/workflows/kotlin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
build:
runs-on: [ self-hosted, macOS, ARM64, wallet-core ]
runs-on: macos-latest-xlarge
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
Expand All @@ -23,6 +23,9 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
Expand All @@ -31,6 +34,15 @@ jobs:
- name: Install system dependencies
run: |
tools/install-sys-dependencies-mac

- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: |
rust

- name: Install Rust dependencies
run: |
tools/install-rust-dependencies

- name: Install emsdk
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/kotlin-sample-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

jobs:
build:
runs-on: [ self-hosted, macOS, ARM64, wallet-core ]
runs-on: macos-latest-xlarge
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
Expand All @@ -23,6 +23,9 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Install Kotlin Dependencies
run: tools/install-kotlin-dependencies

Expand Down
2 changes: 1 addition & 1 deletion samples/kmp/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.trustwallet:wallet-core-kotlin:4.0.0")
implementation("com.trustwallet:wallet-core-kotlin:4.0.5")
}
}
val commonTest by getting {
Expand Down
1 change: 0 additions & 1 deletion swift/Tests/Keystore/KeyStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class KeyStoreTests: XCTestCase {
}

func testImportJSON() throws {

let expected = """
{
"activeAccounts": [{
Expand Down
1 change: 1 addition & 0 deletions tests/chains/Aptos/CompilerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// file LICENSE at the root of the source code distribution tree.

#include "proto/Aptos.pb.h"
#include "proto/TransactionCompiler.pb.h"
#include "HexCoding.h"
#include "PrivateKey.h"
#include "PublicKey.h"
Expand Down
4 changes: 4 additions & 0 deletions tools/android-build
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ set -e
source $(dirname $0)/library
version=$(wc_read_version $1)

if [[ `uname` == "Darwin" ]]; then
export BOOST_ROOT=$(brew --prefix boost)
fi

pushd android
./gradlew assembleRelease
cp wallet-core/build/outputs/aar/wallet-core-release.aar ../build/wallet-core.aar
Expand Down
4 changes: 4 additions & 0 deletions tools/android-release
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ set -e
source $(dirname $0)/library
version=$(wc_read_version $1)

if [[ `uname` == "Darwin" ]]; then
export BOOST_ROOT=$(brew --prefix boost)
fi

echo "Building $version"

export ANDROID_HOME="$HOME/Library/Android/sdk"
Expand Down
50 changes: 50 additions & 0 deletions tools/android-sdk
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

export NDK_API_LEVEL=21

find_android_ndk() {
if [[ "$ANDROID_NDK_HOME" != "" ]]; then
>&2 echo "Use ANDROID_NDK_HOME"
elif [[ "$ANDROID_HOME" != "" ]]; then
>&2 echo "ANDROID_NDK_HOME is not set. Use ANDROID_HOME value instead"
ANDROID_NDK_HOME="$ANDROID_HOME/ndk"
else
>&2 echo "WARNING: ANDROID_HOME is not set. Use a default path"
ANDROID_NDK_HOME="$HOME/Library/Android/sdk/ndk"
fi

TEST_CLANG="aarch64-linux-android$NDK_API_LEVEL-clang"
PATH_TO_CLANG=$(find "$ANDROID_NDK_HOME" -iname $TEST_CLANG -print -quit)

if [[ "$PATH_TO_CLANG" == "" ]]; then
>&2 echo "ERROR: cannot find NDK tools within '$ANDROID_NDK_HOME'"
exit 22
fi

echo $(dirname "$PATH_TO_CLANG")
}

find_android_cmdline_tools() {
# Default version of cmdline tools is 11.
# https://github.com/android-actions/setup-android/blob/9584f05408b63719e3464df8ac85bdbe58f88a64/src/main.ts#L9
CMDLINE_TOOLS_VERSION="11.0"

if [[ "$ANDROID_HOME" == "" ]]; then
>&2 echo "ANDROID_HOME is not set. Use a default path"
ANDROID_HOME="$HOME/Library/Android/sdk"
fi

# cmdline-tools could have a 'latest' version, but if it was installed 2 years ago it may not be 'latest' as of today
if [ -x "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" ]; then
echo "$ANDROID_HOME/cmdline-tools/latest/bin"
return 0
fi

if [ -x "$ANDROID_HOME/cmdline-tools/$CMDLINE_TOOLS_VERSION/bin/sdkmanager" ]; then
echo "$ANDROID_HOME/cmdline-tools/$CMDLINE_TOOLS_VERSION/bin"
return 0
fi

>&2 echo "ERROR: cannot find SDK cmdline tools within '$ANDROID_HOME'"
exit 22
}
10 changes: 9 additions & 1 deletion tools/android-test
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@

set -e

source "$(dirname $0)/android-sdk"

ANDROID_CMDTOOLS=$(find_android_cmdline_tools)

AVD_NAME="integration-tests"
PORT=5556

if [[ `uname` == "Darwin" ]]; then
export BOOST_ROOT=$(brew --prefix boost)
fi

# Make sure it builds before starting an emulator
pushd android
./gradlew assembleAndroidTest
Expand All @@ -17,7 +25,7 @@ SERIAL=emulator-${PORT}

# We have to echo "no" because it will ask us if we want to use a custom hardware profile, and we don't.
echo -e "\nCreating Android emulator...\n"
echo "no" | "$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager" create avd \
echo "no" | "$ANDROID_CMDTOOLS/avdmanager" create avd \
-n "${AVD_NAME}" \
-k "system-images;android-33;google_apis;arm64-v8a" \
-f
Expand Down
10 changes: 7 additions & 3 deletions tools/install-android-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

source "$(dirname $0)/android-sdk"

ANDROID_CMDTOOLS=$(find_android_cmdline_tools)

# Dokka stuff
ROOT="$PWD"
DOKKA_CLI_JAR=https://repo1.maven.org/maven2/org/jetbrains/dokka/dokka-cli/1.7.20/dokka-cli-1.7.20.jar
Expand All @@ -16,10 +20,10 @@ https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-html-jvm/0.8.0/kotl
https://repo1.maven.org/maven2/org/freemarker/freemarker/2.3.31/freemarker-2.3.31.jar
)

$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --verbose "cmake;3.18.1" "ndk;23.1.7779620"
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-26;google_apis;x86"
$ANDROID_CMDTOOLS/sdkmanager --verbose "cmake;3.18.1" "ndk;23.1.7779620"
$ANDROID_CMDTOOLS/sdkmanager "system-images;android-30;google_apis;x86"

echo -e "y\ny\ny\ny\ny\n" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
echo -e "y\ny\ny\ny\ny\n" | $ANDROID_CMDTOOLS/sdkmanager --licenses

echo "Downloading Dokka..."
DOKKA_DIR="$ROOT/build/dokka"
Expand Down
7 changes: 5 additions & 2 deletions tools/install-kotlin-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

"$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --verbose "cmake;3.22.1" "ndk;25.2.9519653"
source "$(dirname $0)/android-sdk"

yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses
ANDROID_CMDTOOLS=$(find_android_cmdline_tools)

$ANDROID_CMDTOOLS/sdkmanager --verbose "cmake;3.22.1" "ndk;25.2.9519653"
yes | $ANDROID_CMDTOOLS/sdkmanager --licenses
4 changes: 4 additions & 0 deletions tools/kotlin-build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

if [[ `uname` == "Darwin" ]]; then
export BOOST_ROOT=$(brew --prefix boost)
fi

pushd kotlin
./gradlew :wallet-core-kotlin:generateProtos
./gradlew :wallet-core-kotlin:assemble
Expand Down
1 change: 1 addition & 0 deletions tools/kotlin-release
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version=$(wc_read_version $1)
echo "Building $version"

export ANDROID_HOME="$HOME/Library/Android/sdk"
export BOOST_ROOT=$(brew --prefix boost)

pushd kotlin
./gradlew :wallet-core-kotlin:generateProtos
Expand Down
4 changes: 4 additions & 0 deletions tools/kotlin-test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

if [[ `uname` == "Darwin" ]]; then
export BOOST_ROOT=$(brew --prefix boost)
fi

pushd kotlin
./gradlew :wallet-core-kotlin:jvmTest
popd
Loading