build(deps-dev): bump lint-staged from 13.0.3 to 15.2.8 #478
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: Android Build | |
on: | |
push: | |
paths-ignore: | |
- 'ios/**' | |
- 'apidoc/**' | |
pull_request: | |
paths-ignore: | |
- 'ios/**' | |
- 'apidoc/**' | |
workflow_dispatch: | |
jobs: | |
android: | |
runs-on: macos-latest | |
name: Android | |
env: | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
USE_CCACHE: 1 | |
SDK_VERSION: 11.0.0.GA | |
MODULE_ID: ti.barcode | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Cache Node.js modules | |
id: node-cache | |
uses: actions/cache@v2 | |
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@v2 | |
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 | |
# TODO: Cache sdk install | |
- run: ti sdk install ${{ env.SDK_VERSION }} --force | |
name: Install Titanium SDK | |
- name: Install ccache | |
run: brew install ccache | |
- name: Retrieve ccache | |
uses: actions/cache@v2 | |
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 | |
with: | |
api-level: 29 | |
target: playstore | |
script: npm run test:android -- --sdkVersion ${{ env.SDK_VERSION }} | |
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: ${{ env.MODULE_ID }}-android | |
path: | | |
android/dist/${{ env.MODULE_ID }}-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 |