Skip to content

Migrated to the new syntax for auto increment. #32

Migrated to the new syntax for auto increment.

Migrated to the new syntax for auto increment. #32

name: Java build (for branches)
on:
push:
branches: [ master ]
jobs:
# 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
# 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 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