Skip to content

One sample includes all #1682

One sample includes all

One sample includes all #1682

name: PullRequest
on: [ pull_request ]
jobs:
buildTest:
name: Build & Test
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: android
strategy:
fail-fast: false
matrix:
os: [ macOS-14 ]
java_version: [ 17 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ matrix.java_version }}
- uses: gradle/wrapper-validation-action@v3
- name: Install Android SDK
uses: hannesa2/action-android/[email protected]
- name: Debug keystore
run: keytool -genkey -v -keystore mainSample/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
- name: Build project
run: ./gradlew assembleDebug
env:
CRYPT_PASS: ${{ secrets.CRYPT_PASS }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
ALIAS_NAME: ${{ secrets.ALIAS_NAME }}
ALIAS_PASS: ${{ secrets.ALIAS_PASS }}
- name: Run tests
run: ./gradlew test
# - name: Run instrumentation tests
# uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4
# with:
# cmd: ./gradlew cAT
# api: 28
# tag: default
# abi: x86
# - name: Archive Espresso results
# uses: actions/[email protected]
# with:
# name: MLKit-Espresso-report
# path: app/build/reports/androidTests/connected
# - name: Save logcat output
# uses: actions/upload-artifact@master
# if: failure()
# with:
# name: MLKit-logcat
# path: artifacts/logcat.log
# - name: Archive screenshots
# uses: actions/[email protected]
# with:
# name: MLKit-Screenshots
# path: screenshots/adb
buildRelease:
name: Build release
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: android
strategy:
matrix:
os: [ macOS-14 ]
java_version: [ 17 ]
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ matrix.java_version }}
- name: Install Android SDK
uses: hannesa2/action-android/[email protected]
- name: Decrypt keystore
run: ./signing/decrypt.sh
env:
CRYPT_PASS: ${{ secrets.CRYPT_PASS }}
- name: Build project
run: ./gradlew assembleRelease
env:
CRYPT_PASS: ${{ secrets.CRYPT_PASS }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
ALIAS_NAME: ${{ secrets.ALIAS_NAME }}
ALIAS_PASS: ${{ secrets.ALIAS_PASS }}
- name: cleanup keystore
run: ./signing/cleanup.sh
Check:
name: Check
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: android
strategy:
matrix:
os: [ ubuntu-latest ]
java_version: [ 17 ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ matrix.java_version }}
- name: Install Android SDK
uses: hannesa2/action-android/[email protected]
- name: Code checks
run: ./gradlew check
- name: Archive Lint report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: MLKit-Lint-report
path: |
./**/build/reports/lint-results-debug.html