2021-02-23 06:29:59 -07:00
|
|
|
name: Validate Android
|
2021-02-23 05:59:42 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-23 06:00:32 -07:00
|
|
|
- main
|
2021-02-23 05:59:42 -07:00
|
|
|
paths:
|
2021-02-23 06:29:59 -07:00
|
|
|
- '.github/workflows/validate-android.yml'
|
2021-02-23 05:59:42 -07:00
|
|
|
- 'android/**'
|
2021-02-26 02:56:20 -07:00
|
|
|
- '.editorconfig'
|
2021-02-23 05:59:42 -07:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2021-02-23 06:29:59 -07:00
|
|
|
- '.github/workflows/validate-android.yml'
|
2021-02-23 05:59:42 -07:00
|
|
|
- 'android/**'
|
2021-02-26 02:56:20 -07:00
|
|
|
- '.editorconfig'
|
2021-02-23 05:59:42 -07:00
|
|
|
|
|
|
|
jobs:
|
2021-02-23 06:35:55 -07:00
|
|
|
lint:
|
|
|
|
name: Gradle Lint
|
2021-02-23 05:59:42 -07:00
|
|
|
runs-on: ubuntu-latest
|
2021-02-23 06:06:15 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
2023-09-01 10:15:28 -06:00
|
|
|
working-directory: ./package/android
|
2021-02-23 05:59:42 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-02-09 03:52:41 -07:00
|
|
|
- name: Setup JDK 11
|
2021-02-23 05:59:42 -07:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2023-02-09 03:52:41 -07:00
|
|
|
java-version: 11
|
2021-03-08 09:51:47 -07:00
|
|
|
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- name: Restore node_modules from cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install node_modules
|
|
|
|
run: yarn install --frozen-lockfile --cwd ..
|
2021-06-27 04:37:54 -06:00
|
|
|
- name: Install node_modules for example/
|
|
|
|
run: yarn install --frozen-lockfile --cwd ../example
|
2021-03-08 09:51:47 -07:00
|
|
|
|
|
|
|
- name: Restore Gradle cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-
|
2021-02-23 05:59:42 -07:00
|
|
|
- name: Run Gradle Lint
|
2021-06-27 04:37:54 -06:00
|
|
|
run: ./gradlew lint --build-cache
|
2021-03-08 09:51:47 -07:00
|
|
|
|
|
|
|
- name: Parse Gradle Lint Report
|
|
|
|
uses: yutailang0119/action-android-lint@v1.0.2
|
2021-02-23 05:59:42 -07:00
|
|
|
with:
|
2021-02-23 06:12:17 -07:00
|
|
|
xml_path: android/build/reports/lint-results.xml
|
2021-06-27 04:37:54 -06:00
|
|
|
# ktlint:
|
|
|
|
# name: Kotlin Lint
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - name: Run KTLint
|
|
|
|
# uses: mrousavy/action-ktlint@v1.7
|
|
|
|
# with:
|
|
|
|
# github_token: ${{ secrets.github_token }}
|