name: Pull Request Workflow

on:
  pull_request:
    branches:
      - modular
  push:
    branches:
      - modular

jobs:
  testing:
    name: Lint and Test Suite [Unit, Instrumented]

    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Decode Firebase google-services.json
        env:
          FIREBASE_CONFIG: ${{secrets.FIREBASE_CONFIG}}
        run: echo $FIREBASE_CONFIG > app/google-services.json

      - name: Run ktlint
        run: ./gradlew ktlint

      - name: Run Android lint
        run: ./gradlew lintDebug

      - name: Run unit tests
        run: ./gradlew testDebugUnitTest

      - name: Execute Instrumentation Tests (gradlew connectedCheck - api 23)
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 23
          target: default
          arch: x86
          profile: Nexus 6
          script: ./gradlew app:connectedCheck --stacktrace

name: Pull Request Workflow

on:
  pull_request:
    branches:
      - modular
  push:
    branches:
      - modular

jobs:
  testing:
    name: Lint and Test Suite [Unit, Instrumented]

    runs-on: macos-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Decode Firebase google-services.json
        env:
          FIREBASE_CONFIG: ${{secrets.FIREBASE_CONFIG}}
        run: echo $FIREBASE_CONFIG > app/google-services.json

      - name: Run ktlint
        run: ./gradlew ktlint

      - name: Run Android lint
        run: ./gradlew lintDebug

      - name: Run unit tests
        run: ./gradlew testDebugUnitTest

      - name: Execute Instrumentation Tests (gradlew connectedCheck - api 23)
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 23
          target: default
          arch: x86
          profile: Nexus 6
          script: ./gradlew app:connectedCheck --stacktrace

Update pull request ci config
Update pull request ci config
