name: Verify Pull request is fine

on:
  pull_request:
    branches:
      - develop

env:
  GITHUB_USERNAME: "fknives"
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  run-tests:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '11'
      - name: Run Unit Tests
        run: ./gradlew :app:testDebugUnitTest --tests "org.fnives.tiktokdownloader.*"
      - name: Upload Test Results
        uses: actions/upload-artifact@v2
        if: always()
        with:
          name: Test Results
          path: ./**/build/reports/tests/**/index.html
          retention-days: 1
