name: PullRequest

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  buildTest:
    name: Build & Run Unit-Tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 8
      - name: Build project
        run: ./gradlew assembleDebug
      - name: Run tests
        run: ./gradlew test
      - name: Jacoco
        run: ./gradlew :tracker:jacocoTestReport
      - name: Codecov
        run: bash <(curl -s https://codecov.io/bash)
  Check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Install JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 8
      - name: Code checks
        run: ./gradlew check
      - name: Archive Lint report
        uses: actions/upload-artifact@v2.0.1
        if: ${{ always() }}
        with:
          name: Matomo-Lint-report
          path: tracker/build/reports/lint-results.html

name: PullRequest

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  buildTest:
    name: Build & Run Unit-Tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 11
      - name: Build project
        run: ./gradlew assembleDebug
      - name: Run tests
        run: ./gradlew test
      - name: Jacoco
        run: ./gradlew :tracker:jacocoTestReport
      - name: Codecov
        run: bash <(curl -s https://codecov.io/bash)
  Check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Install JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 11
      - name: Code checks
        run: ./gradlew check
      - name: Archive Lint report
        uses: actions/upload-artifact@v2.0.1
        if: ${{ always() }}
        with:
          name: Matomo-Lint-report
          path: tracker/build/reports/lint-results.html

Fix CI, Gradle 7.X needs Java 11
Fix CI, Gradle 7.X needs Java 11
