name: Java CI
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: ['8', '11', '14']
    env:
      WORKSPACE: ${{ github.workspace }}
      GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
      RUN_TESTS_ONLY: false
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Optional setup step
        run: |
          [ -f ./setup.sh ] && ./setup.sh || true
      - name: Run Tests
        run: ./gradlew check assemble --refresh-dependencies -Dgrails.env=test -Dgeb.env=chromeHeadless
      - name: Publish Test Report
        uses: scacap/action-surefire-report@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          report_paths: '**/build/test-results/test/TEST-*.xml'

name: Java CI
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:
    inputs:
      message:
        description: 'Snapshot information (e.g. New Core Snapshot Tue Dec 15 00:07:18 UTC 2020 f212f54)'
        required: true
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: ['8', '11', '14']
    env:
      WORKSPACE: ${{ github.workspace }}
      GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
      RUN_TESTS_ONLY: false
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - name: Print Dispatch Information
        if: github.event_name == 'workflow_dispatch'
        env:
          DISPATCH_INFORMATION: ${{ github.event.inputs.message }}
        run: echo $DISPATCH_INFORMATION
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Optional setup step
        run: |
          [ -f ./setup.sh ] && ./setup.sh || true
      - name: Run Tests
        run: ./gradlew check assemble --refresh-dependencies -Dgrails.env=test -Dgeb.env=chromeHeadless
      - name: Publish Test Report
        uses: scacap/action-surefire-report@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          report_paths: '**/build/test-results/test/TEST-*.xml'

Enable Java CI workflow dispatch
Enable Java CI workflow dispatch
