Merge pull request #8 from kishandonga/develop #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: EasyPref CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
jobs: | |
test: | |
runs-on: macos-latest | |
env: | |
JAVA_TOOL_OPTIONS: -Xmx4g | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
api-level: [19,26,29] | |
target: [default] | |
arch: [x86] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache | |
uses: actions/[email protected] | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
~/.android/debug.keystore | |
key: avd-${{ matrix.api-level }}-macos-latest-${{ matrix.target }} | |
- name: Assemble Tests | |
uses: gradle/[email protected] | |
with: | |
arguments: assembleAndroidTest | |
- name: Run Emulator to Generate Snapshot for Caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: ReactiveCircus/[email protected] | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: ${{ matrix.arch }} | |
profile: Galaxy Nexus | |
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 TestCase Action | |
uses: ReactiveCircus/[email protected] | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: ${{ matrix.arch }} | |
profile: Galaxy Nexus | |
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 | |
pre-emulator-launch-script: | | |
echo "Running pre-emulator launch script." | |
script: | | |
echo $GITHUB_REPOSITORY | |
adb devices | |
./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.sample.easyprefs.kotlin.TestSuite -i | |