Use java-commons 1.2.0. #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java build (for branches) | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
# JDK8 build without Sonar, because Sonar requires JDK17 and we don't need to run Sonar on all JDKs anyway | |
build8: | |
name: Build on JDK 8 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 8 | |
- name: Cache Maven packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
# See | |
# https://maurocanuto.medium.com/using-github-private-packages-and-maven-in-github-actions-c9e2ea69e2bc | |
# https://github.com/s4u/maven-settings-action | |
- name: maven-settings | |
uses: s4u/maven-settings-action@v3.0.0 | |
with: | |
servers: | | |
[{ | |
"id": "github-the4thlaw", | |
"username": "The4thLaw", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}] | |
githubServer: false | |
- name: Build with Maven | |
run: mvn -B clean verify -DCI=true | |
working-directory: ./source | |
# JDK17 build with Sonar | |
build17: | |
name: Build on JDK 17 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Shallow clones are disabled for a better relevancy of analysis | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- 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: maven-settings | |
uses: s4u/maven-settings-action@v3.0.0 | |
with: | |
servers: | | |
[{ | |
"id": "github-the4thlaw", | |
"username": "The4thLaw", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}] | |
githubServer: false | |
- 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 clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=The4thLaw_demyo -DCI=true -Pvue,coverage,dev | |
working-directory: ./source |