name: CI

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

jobs:
  build:
    name: Build and Test (${{ matrix.os }} / OpenJDK ${{ matrix.jdk }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        jdk: ['8', '11']
        os: [ubuntu-latest, windows-latest, macOS-latest]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK ${{ matrix.jdk }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.jdk }}
      - name: Cache SonarCloud packages
        uses: actions/cache@v1
        with:
          path: ~/.sonar/cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Cache Maven packages
        uses: actions/cache@v1
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Build and analyze
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: mvn -B verify

name: CI

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

jobs:
  build:
    name: Build and Test (${{ matrix.os }} / OpenJDK ${{ matrix.jdk }})
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        jdk: ['8', '11', '15']
        os: [ubuntu-latest, windows-latest, macOS-latest]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Set up JDK ${{ matrix.jdk }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.jdk }}
      - name: Cache SonarCloud packages
        uses: actions/cache@v1
        with:
          path: ~/.sonar/cache
          key: ${{ runner.os }}-sonar
          restore-keys: ${{ runner.os }}-sonar
      - name: Cache Maven packages
        uses: actions/cache@v1
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2
      - name: Build and analyze
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: mvn -B verify

Include latest JDK (15) release
[feature] Include latest JDK (15) release
