name: Test
on: push

jobs:
  test:
    name: Run Unit Tests
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

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

      - name: Run JUnit tests
        run: bash ./gradlew test
        working-directory: ./MoviesTVSentiments

      - name: Run Espresso tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          working-directory: ./MoviesTVSentiments
          api-level: 29
          script: ./gradlew connectedAndroidTest --info

      - name: Upload test report
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: test-report
          path: /Users/runner/work/play-movies-2020-intern/play-movies-2020-intern/MoviesTVSentiments/app/build/reports/androidTests/connected/ 

name: Test
on: push

jobs:
  test:
    name: Run Unit Tests
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

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

      - name: Run JUnit tests
        run: bash ./gradlew test
        working-directory: ./MoviesTVSentiments

      - name: Run Espresso tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          working-directory: ./MoviesTVSentiments
          api-level: 29
          script: |
            adb logcat -c
            adb logcat *:E &
            ./gradlew connectedAndroidTest

      - name: Upload test report
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: test-report
          path: /Users/runner/work/play-movies-2020-intern/play-movies-2020-intern/MoviesTVSentiments/app/build/reports/androidTests/connected/ 

Print logcat output in CI
Print logcat output in CI
