---
name: Java CI

on: [push]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-2016, windows-latest]
        java: [8, 11, 15]
      fail-fast: false
      max-parallel: 4
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Test with Maven
        run: mvn test -B --file pom.xml

  sonarcloud:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          # Disabling shallow clone is recommended for improving relevancy of reporting
          fetch-depth: 0
          java-version: 8
      - name: SonarCloud Scan
        uses: SonarSource/sonarcloud-github-action@master
        with:
          args: >
            -DskipTests
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

...

---
name: Java CI

on: [push]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-2016, windows-latest]
        java: [8, 11, 15]
      fail-fast: false
      max-parallel: 4
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Test with Maven
        run: mvn test -B --file pom.xml

  sonarcloud:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          # Disabling shallow clone is recommended for improving relevancy of reporting
          fetch-depth: 0
          java-version: 8
      - name: Sonar with Maven
        run: mvn sonar:sonar -B --file pom.xml -DskipTests
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

...

Replace sonar action with direct usage as it doesn't support maven for some reason...
[actions] Replace sonar action with direct usage as it doesn't support maven for some reason...
