Skip to content

Instantly share code, notes, and snippets.

@ruben-h
Created October 9, 2020 12:23
Show Gist options
  • Save ruben-h/23c2dcce9a32c0fc09404fee2de9ad41 to your computer and use it in GitHub Desktop.
Save ruben-h/23c2dcce9a32c0fc09404fee2de9ad41 to your computer and use it in GitHub Desktop.
Github Actions workflow for simple a Android build and test project. place the file in /.github/workflows/android.yml
name: Android CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- name: Run JUnit tests with Gradle
run: ./gradlew test
androidTest:
runs-on: macOS-latest #Have to use mac os for HAXM hw acceleration. although it uses 10x more run minutes than ubuntu on GH actions
steps:
- uses: actions/checkout@v2
- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86
disable-animations: true
script: ./gradlew connectedAndroidTest --stacktrace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment