Updated example for GitHub

When creating a new C# .NET project in SonarCloud linked to GitHub, the wizard for GitHub Action on step 2 shows a sample build.yml.

This is example looks to be at least two years old, as it uses an old version of the action to setup Java:

      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 1.11

Immediately after using this GitHub’s Dependabot wants to bump this to version 3, and this brings in several breaking changes, and I now have to choose which distribution of Java I want to use. Zulu OpenJDK as the default in version 1, so I guess this is good to use still? Or are any of these preferred:

  • Eclipse Temurin
  • Zulu OpenJDK
  • Adopt OpenJDK Hotspot
  • Adopt OpenJDK OpenJ9
  • Liberica JDK
  • Microsoft Build of OpenJDK
  • Amazon Corretto Build of OpenJDK

Also the version in your example states version “1.11”, while the newer versions of the Java setup seems to want the version as “11”.

It might be worth mentioning that we are building on Ubuntu, the example only shows for Windows. We are also using SonarCloud for private projects with a paid plan.

I would really appreciate if an up to date example could be presented; here or in the wizard :innocent: