Skip to content

workflow update

workflow update #513

Workflow file for this run

name: Android Build
on:
push:
paths-ignore:
- 'ios/**'
- 'apidoc/**'
pull_request:
paths-ignore:
- 'ios/**'
- 'apidoc/**'
workflow_dispatch:
jobs:
android:
runs-on: ubuntu-latest
name: Android
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Node.js modules
id: node-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-modules-
${{ runner.OS }}-
- run: npm ci
name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- run: npm run lint:android
name: Lint
- run: npm i -g titanium
name: Install Titanium CLI
- run: ti sdk install 12.2.1.GA
name: Install SDK 12.2.1
# - name: Set up Homebrew
# id: set-up-homebrew
# uses: Homebrew/actions/setup-homebrew@master
#
# - name: Install ccache
# run: brew install ccache
#
# - name: Retrieve ccache
# uses: actions/cache@v3
# with:
# path: ${{ env.CCACHE_DIR }}
# key: ${{ runner.os }}-ccache-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-ccache-
- name: Build and Test
uses: reactivecircus/android-emulator-runner@v2
env:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 120
with:
api-level: 29
target: playstore
script: npm run test:android -- --sdkVersion 12.2.1.GA
disable-animations: false # defaulting to true, the commands sent to emulator to do this sometimes run too quickly after boot and cause "adb: device offline" failures
- name: Show summary of ccache configuration and statistics counters
run: ccache --show-stats
# TODO: Grab the version so zip file name can contain it
- name: Archive Android zip
uses: actions/upload-artifact@v2
with:
name: ti.identity-android
path: |
android/dist/ti.identity-android-*.zip
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties