Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #215

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #215

Workflow file for this run

name: Android
on:
push:
branches:
- master
pull_request: {}
env:
CARGO_TERM_COLOR: always
ANDROID_NDK_VER: r25c
ANDROID_NDK_FULL_VER: 25.2.9519653
HOST: linux-x86_64
DEBUG: debug
jobs:
android-lib:
runs-on: ubuntu-20.04
strategy:
matrix:
target: [ i686-linux-android, x86_64-linux-android, armv7-linux-androideabi, aarch64-linux-android ]
steps:
- uses: actions/checkout@v3
- name: Setup cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-android-lib-${{ matrix.target }}-${{ env.ANDROID_NDK_VER }}--${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Setup Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.ANDROID_NDK_VER }}
- run: echo "NDK=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
- run: cd lib && ./build-android/${{ matrix.target }}.sh
- name: Upload libs
uses: actions/upload-artifact@v3
with:
name: lib_${{ matrix.target }}
path: target/${{ matrix.target }}/${{ env.DEBUG }}/libfirma.so
android-apk:
runs-on: ubuntu-20.04
needs: android-lib
strategy:
matrix:
network: [Testnet, Mainnet, Regtest]
steps:
- uses: actions/checkout@v3
- name: Setup cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cache-android-apk-${{ matrix.network }}-${{ env.ANDROID_NDK_VER }}--${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Setup Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.ANDROID_NDK_VER }}
- run: echo "ndk.dir=${{ steps.setup-ndk.outputs.ndk-path }}" >> ${{ github.workspace }}/android/local.properties
- run: mkdir -p android/app/src/main/jniLibs/{x86,x86_64,armeabi-v7a,arm64-v8a}
- uses: actions/[email protected]
with:
name: lib_i686-linux-android
- run: mv libfirma.so android/app/src/main/jniLibs/x86/
- uses: actions/[email protected]
with:
name: lib_x86_64-linux-android
- run: mv libfirma.so android/app/src/main/jniLibs/x86_64/
- uses: actions/[email protected]
with:
name: lib_armv7-linux-androideabi
- run: mv libfirma.so android/app/src/main/jniLibs/armeabi-v7a/
- uses: actions/[email protected]
with:
name: lib_aarch64-linux-android
- run: mv libfirma.so android/app/src/main/jniLibs/arm64-v8a/
- name: Build apk
run: |
cd android
./gradlew assembleNetwork${{ matrix.network }}
- name: Upload apk
uses: actions/upload-artifact@v3
with:
name: apk_${{ matrix.network }}
path: android/app/build/outputs/apk/network${{ matrix.network }}/debug/app-network${{ matrix.network }}-debug.apk
android-test:
runs-on: macos-11
needs: android-lib
strategy:
fail-fast: false
matrix:
api: [ 21, 28 ]
steps:
- uses: actions/checkout@v3
- run: mkdir -p android/app/src/main/jniLibs/{x86,x86_64,armeabi-v7a,arm64-v8a}
- uses: actions/[email protected]
with:
name: lib_i686-linux-android
- run: mv libfirma.so android/app/src/main/jniLibs/x86/
- name: Setup Android NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.ANDROID_NDK_VER }}
- name: Run Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api }}
target: default
ndk: ${{ env.ANDROID_NDK_FULL_VER }}
arch: x86
script: cd android && ./gradlew connectedCheck --stacktrace
- name: Upload test reports
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: tests_report_${{ matrix.api }}
path: ${{ github.workspace }}/android/app/build/reports/androidTests/connected/flavors/