1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-02-22 00:13:11 +02:00

Merge pull request #1426 from 1C-Company/sonar-jdk17

Move sonar scan to JDK-17
This commit is contained in:
Dmitriy Marmyshev 2024-03-03 19:46:24 -08:00 committed by GitHub
commit 478e94c7f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,13 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-latest-
- name: Build with Maven
working-directory: ./
run: |
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
export DISPLAY=:5
mvn clean verify -PSDK,find-bugs -Dtycho.localArtifacts=ignore -B -V
- name: Cache SonarCloud packages
uses: actions/cache@v2
if: inputs.analyze
@ -59,19 +66,22 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build with Maven
- name: Set up JDK 17
if: inputs.analyze
uses: actions/setup-java@v1
with:
java-version: 17
java-package: jdk
- name: Sonar scan
# Do not start Sonar-scanning for forks without label, and pass fork PR number directly
if: inputs.analyze
env:
# Do not start Sonar-scanning for forks without label, and pass fork PR number directly
SONAR_PARAM: "${{ inputs.analyze && format('{0}{1}', 'org.sonarsource.scanner.maven:sonar-maven-plugin:sonar', env.PR_NUMBER) || '' }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.sonar_token }}
working-directory: ./
run: |
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
export DISPLAY=:5
echo "Sonar param: \"${SONAR_PARAM}\""
mvn clean verify ${SONAR_PARAM} -PSDK,find-bugs -Dtycho.localArtifacts=ignore -B -V
run: mvn compile org.sonarsource.scanner.maven:sonar-maven-plugin:sonar ${{ env.PR_NUMBER }} -Dtycho.localArtifacts=ignore -B -V
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: inputs.analyze
@ -96,7 +106,6 @@ jobs:
with:
name: jacoco
path: |
./**/target/jacoco.exec
./**/target/site/jacoco*/
- name: Upload test logs on failure