Skip to content

Commit

Permalink
fix: move app check yml file back to local repo (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchuangatmp authored Jun 27, 2022
1 parent 65b3a1f commit 7e4239f
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ updates:
timezone: "America/New_York"
target-branch: "chore/dependabot"
labels: ['dependabot']
open-pull-requests-limit: 10
open-pull-requests-limit: 10
commit-message:
prefix: "chore"
136 changes: 136 additions & 0 deletions .github/workflows/pull-request-app-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: "Android Sample App Checks"

on:

workflow_call:
inputs:
app_relative_path:
description: 'repo path for sample app'
required: true
type: string

jobs:

confirm-folder-changes:
name: "Confirm changes in sample app folder"
runs-on: ubuntu-18.04
steps:
- name: "Checkout Sample Apps"
uses: actions/checkout@v2
with:
submodules: recursive
# - name: "Create Path Triggers"
# uses: dorny/paths-filter@v2
# id: changes
# with:
# base: main
# ref: ${{ github.head_ref }}
# filters: |
# sample-app:
# - '${{ inputs.app_relative_path }}/**'
# - name: "Cancel workflow"
# if: steps.changes.outputs.sample-app != 'true'
# uses: andymckay/cancel-action@0.2

instrumented-tests:
name: "Instrumented Tests"
timeout-minutes: 30
runs-on: macos-11
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "Install JDK 11"
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: "Run Instrumented Tests"
uses: reactivecircus/android-emulator-runner@v2.20.0
with:
working-directory: ${{ inputs.app_relative_path }}
api-level: 29
script: ./gradlew connectedCheck
- name: "Archive Instrumented Tests Results"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "instrumented-tests-results"
path: ./**/build/reports/androidTests/connected/**

unit-tests:
name: "Unit Tests"
timeout-minutes: 15
runs-on: ubuntu-18.04
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "Install JDK 11"
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: "Run Unit Tests"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew test
- name: "Android Unit Tests Report"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "unit-tests-results"
path: ./**/build/reports/**

lint-checks:
name: "Lint Checks"
timeout-minutes: 15
runs-on: macos-11
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "Install JDK 11"
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: "Run Android Core SDK Lint"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew lint
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "lint-results"
path: ./**/build/reports/**

kotlin-lint-checks:
name: "Kotlin Lint Checks"
timeout-minutes: 15
runs-on: macos-11
needs: confirm-folder-changes
steps:
- name: "Checkout Branch"
uses: actions/checkout@v2
with:
submodules: recursive
- name: "Install JDK 11"
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: "Run Android Core SDK Kotlin Lint"
working-directory: ${{ inputs.app_relative_path }}
run: ./gradlew ktlintCheck
- name: "Archive Lint Test Results"
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: "kotlin-lint-results"
path: ./**/build/reports/**

0 comments on commit 7e4239f

Please sign in to comment.