name: Continuous Integration (Low Cadence)
on:
  schedule:
    - cron: '0 0,12 * * *'

env:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"

jobs:
  java-slow-test-build:
    name: Java Slow Tests (JDK ${{ matrix.java }}, ${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        java: [ '8', '11' ]
        os: [ 'ubuntu-latest' ]
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Cache Gradle dependencies
        uses: actions/cache@v1
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }}
          restore-keys: |
            ${{ runner.os }}-gradle-caches-
      - name: Cache Gradle wrappers
        uses: actions/cache@v1
        with:
          path: ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-wrapper
      - name: Setup java
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Build and Run Slow Tests with Gradle
        run: ./gradlew slowTest

name: Continuous Integration (Low Cadence)
on:
  repository_dispatch:
    types: run-slow-tests
  schedule:
    - cron: '0 0,12 * * *'

env:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"

jobs:
  java-slow-test-build:
    name: Java Slow Tests (JDK ${{ matrix.java }}, ${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        java: [ '8', '11' ]
        os: [ 'ubuntu-latest' ]
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Cache Gradle dependencies
        uses: actions/cache@v1
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }}
          restore-keys: |
            ${{ runner.os }}-gradle-caches-
      - name: Cache Gradle wrappers
        uses: actions/cache@v1
        with:
          path: ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-wrapper
      - name: Setup java
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Build and Run Slow Tests with Gradle
        run: ./gradlew slowTest

Allow slow tests to be triggered by a repository dispatch event.
[Java] Allow slow tests to be triggered by a repository dispatch event.
