]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | name: CI_Android |
2 | on: | |
3 | push: | |
4 | branches: [ master ] | |
5 | pull_request: | |
6 | branches: [ master ] | |
7 | ||
8 | jobs: | |
9 | Android: | |
10 | runs-on: macos-latest | |
11 | defaults: | |
12 | run: | |
13 | working-directory: build | |
14 | steps: | |
15 | - uses: actions/checkout@v2 | |
16 | ||
17 | - name: Create build directory | |
18 | run: mkdir -p build | |
19 | working-directory: . | |
20 | ||
21 | - name: Start emulator | |
22 | run: | | |
23 | echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-24;default;x86_64' | |
24 | echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-24;default;x86_64' --force | |
25 | $ANDROID_HOME/emulator/emulator -list-avds | |
26 | echo "Starting emulator" | |
27 | # Start emulator in background | |
28 | nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 & | |
29 | echo "Emulator starting" | |
30 | ||
31 | - name: Configure | |
32 | run: cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=16 -DANDROID_ABI=x86_64 -DCMAKE_BUILD_TYPE=Debug .. | |
33 | ||
34 | - name: Build | |
35 | run: cmake --build . --parallel | |
36 | ||
37 | - name: Wait for emulator ready | |
38 | run: | | |
39 | $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 10; done; input keyevent 82' | |
40 | $ANDROID_HOME/platform-tools/adb devices | |
41 | $ANDROID_HOME/platform-tools/adb shell getprop ro.product.cpu.abi | |
42 | echo "Emulator started" | |
43 | ||
44 | - name: Deploy tests | |
45 | run: | | |
46 | adb push tests /data/local/tmp | |
47 | adb shell find /data/local/tmp/tests -maxdepth 1 -exec chmod +x {} \\\; | |
48 | ||
49 | - name: Test | |
50 | run: adb shell find /data/local/tmp/tests -name "*_tests" -maxdepth 1 -exec {} \\\; |