forked from readdle/swift-java-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.94 KB
/
android.yml
File metadata and controls
41 lines (37 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Android CI
on: [push]
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install Swift toolchain 5.0.3
run: wget https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg;
sudo installer -pkg swift-5.0.3-RELEASE-osx.pkg -target /
- name: Install NDK
run: wget https://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip;
unzip android-ndk-r17c-darwin-x86_64.zip
- name: Install Swift Android Toolchain
run: SWIFT_ANDROID=$(curl -fsSL https://api.bintray.com/packages/readdle/swift-android-toolchain/swift-android-toolchain/versions/_latest | python -c 'import json,sys;print(json.load(sys.stdin))["name"]');
wget https://dl.bintray.com/readdle/swift-android-toolchain/swift-android-$SWIFT_ANDROID.zip;
unzip swift-android-$SWIFT_ANDROID.zip;
swift-android-$SWIFT_ANDROID/bin/swift-android tools --update;
ln -sfn swift-android-$SWIFT_ANDROID swift-android-current
- name: Download Android Emulator
run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-29;google_apis;x86_64"
- name: Create Android Emulator
run: $ANDROID_HOME/tools/bin/avdmanager create avd -n ci-test -k "system-images;android-29;google_apis;x86_64" -d "pixel" --force
- name: Start Android Emulator
run: $ANDROID_HOME/emulator/emulator -no-window -avd ci-test -noaudio > /dev/null &
- name: Run connected android tests
run: export TOOLCHAINS=org.swift.50320190830a;
export ANDROID_NDK_HOME=$(pwd)/android-ndk-r17c;
export SWIFT_ANDROID_HOME=$(pwd)/swift-android-current;
export PATH=$ANDROID_NDK_HOME:$PATH;
export PATH=$SWIFT_ANDROID_HOME/bin:$SWIFT_ANDROID_HOME/build-tools/current:$PATH;
adb wait-for-device;
./gradlew sample:cAT