Skip to content

fix build scripts

fix build scripts #72

Workflow file for this run

name: Android Test & Build
on: push
jobs:
android-build:
name: Android Test & Build
runs-on: ubuntu-latest
steps:
# clone the repo to workspace
- name: Check out Git repository
uses: actions/checkout@v2
# setup JDK environment
- name: Set up our JDK environment
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
# setup node environment
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: '18.17.1'
cache: 'yarn'
# install project dependencies
- name: Install dependencies for lib
run: yarn install --frozen-lockfile
- name: Install dependencies for TestApp
run: cd TestApp && yarn install --frozen-lockfile && cd ..
## configure cache for gradle
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
## make gradlew executable in ci
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: Run Android unit tests
run: cd TestApp/android && ./gradlew clean && ./gradlew testDebugUnitTest && cd ../..
- name: Bundle JS for Android
run: cd TestApp && mkdir android/app/src/main/assets && yarn bundle:android-dev && cd ..
- name: Build Android Test App
run: cd TestApp/android && ./gradlew clean && ./gradlew app:assembleDebug && cd ../..