Development #17
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: Check PR | |
on: | |
# Triggers the workflow on every pull request to master branch | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Load API Key from secrets | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
run: echo API_KEY=\"API_KEY\" > ./local.properties | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | |
- name: Copy gradle properties file | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Build the app | |
run: ./gradlew assembleDebug | |
- name: Upload apk | |
uses: actions/upload-artifact@v2 | |
with: | |
name: debug apk | |
path: app/build/outputs/apk/debug/app-debug.apk | |
test: | |
runs-on: macos-latest | |
needs: build | |
timeout-minutes: 55 | |
strategy: | |
matrix: | |
api-level: [26, 30] | |
target: [default] | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Load API key from secrets | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
run: echo API_KEY=\"API_KEY\" > ./local.properties | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | |
- name: Copy gradle properties file | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Run unit tests | |
run: ./gradlew test --stacktrace | |
- name: Instrumentation Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
disable-animations: true | |
disk-size: 6000M | |
heap-size: 600M | |
script: ./gradlew connectedCheck --stacktrace | |
- name: Upload Reports | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test-Reports | |
path: app/build/reports | |
if: always() |