Skip to content

Merge squash commit #107

Merge squash commit

Merge squash commit #107

Workflow file for this run

name: Android CI
on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- '**/README.md'
pull_request:
branches: [ "master" ]
paths-ignore:
- '**/README.md'
jobs:
instrumentation-tests:
name: Instrumentation tests
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
api-level: [24]
target: [default]
arch: [x86_64]
abi: [x86, x86_64]
include:
- api-level: 30
target: google_apis
arch: x86_64
abi: armeabi-v7a
- api-level: 30
target: google_apis
arch: x86_64
abi: arm64-v8a
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# # If you have an existing workflow invoking Gradle, you can add an initial "Setup Gradle" Step to benefit from caching,
# # build-scan capture and other features. All subsequent Gradle invocations will benefit from
# # this initial setup, via init scripts added to the Gradle User Home.
# # See https://github.com/ReactiveCircus/android-emulator-runner/issues/229 for improving performance
# # see https://github.com/gradle/gradle-build-action
- name: Setup and build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: |
:liboqs-android:clean
:liboqs-android:assembleDebugAndroidTest
# github action for storing relevant files for future restore (defined via 'path').
# It can store up to 10GB per repo, where github starts evicting old caches.
# see https://github.com/actions/cache
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
/Users/runner/gradle-installations/*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
emulator-boot-timeout: 600
avd-name: test
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: pixel_2
avd-name: test
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
./gradlew :liboqs-android:installDebugAndroidTest -Pabi-splits=${{ matrix.abi }}
adb shell am instrument -w --abi ${{ matrix.abi }} -e debug false -e package com.example.android com.example.android.test/androidx.test.runner.AndroidJUnitRunner
#./gradlew :liboqs-android:connectedDebugAndroidTest