name: Java Format

on: [push, pull_request]

jobs:
  format:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 8
        uses: actions/setup-java@v1
        with:
          java-version: 8
      - name: Download google-java-format 1.8
        run: wget -q https://github.com/google/google-java-format/releases/download/google-java-format-1.8/google-java-format-1.8-all-deps.jar
      - name: Format with google-java-format 1.8
        run: |
          FILES=`find . -name "*.java" -type f`
          echo "Found the following Java files:"
          for file in $FILES; do
            echo $file
          done
          echo ""
          EXIT=0
          for file in $FILES; do
            echo -e "Running google-java-format on:\n $file\n"
            if ! java -jar ./google-java-format-1.8-all-deps.jar $file | diff $file -; then
              EXIT=1
            fi
            echo ""
          done
          exit $EXIT
        shell: bash

name: Java Format

on: [push, pull_request]

jobs:
  format:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Download google-java-format 1.8
        run: wget -q https://github.com/google/google-java-format/releases/download/google-java-format-1.8/google-java-format-1.8-all-deps.jar
      - name: Format with google-java-format 1.8
        run: |
          FILES=`find . -name "*.java" -type f`
          echo "Found the following Java files:"
          for file in $FILES; do
            echo $file
          done
          echo ""
          EXIT=0
          for file in $FILES; do
            echo -e "Running google-java-format on:\n $file\n"
            if ! java -jar ./google-java-format-1.8-all-deps.jar $file | diff $file -; then
              EXIT=1
            fi
            echo ""
          done
          exit $EXIT
        shell: bash

Revert formatting back to java 11.
Revert formatting back to java 11.
