Skip to content

Refactor init script #145

Refactor init script

Refactor init script #145

name: Android PR Check
on: [ pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
# Matches all files which can affect iOS build, when changed
iosFiles: ${{ steps.file-changes.outputs.iosFiles }}
# Matches all files which can affect Android build, when changed
androidFiles: ${{ steps.file-changes.outputs.androidFiles }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect Changes
uses: dorny/paths-filter@v2
id: file-changes
with:
filters: |
iosFiles:
- "!(androidApp/**)"
androidFiles:
- "!(iosApp/**)"
pr-check:
name: Android PR check
runs-on: [ ubuntu-latest ]
needs: detect-changes
if: ${{ needs.detect-changes.outputs.androidFiles == 'true' }}
env:
# TODO PROJECT-SETUP Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run Lint check
shell: bash
# `lintRelease` covers androidApp module and all shared modules all at once. No need to call `lintEnterprise` and `lintRelease`.
run: ./gradlew --continue lintCheck lintRelease
- name: Run unit tests
shell: bash
# `testReleaseUnitTest` covers androidApp module and all shared modules all at once. No need to call `testEnterpriseUnitTest` and `testReleaseUnitTest`.
run: ./gradlew --continue testReleaseUnitTest
- name: Danger action
uses: MeilCli/danger-action@v2
continue-on-error: true
with:
plugins_file: 'Gemfile'
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
- name: Slack Notification
if: failure()
uses: homoluctus/slatify@master
with:
type: "failure"
job_name: '*PR Check*'
username: GitHub
channel: ${{env.SLACK_CHANNEL}}
url: ${{ secrets.SLACK_WEB_HOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}