Java mismatch in workflow
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1m13s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1m13s
This commit is contained in:
@@ -15,18 +15,38 @@ jobs:
|
|||||||
- name: Checking out
|
- name: Checking out
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# FIX: Add Java 17 setup before SonarQube scan
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: SonarQube Scan
|
- name: Cache SonarQube packages
|
||||||
uses: kitabisa/sonarqube-action@v1.2.0
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SONARQUBE_HOST }}
|
path: ~/.sonar/cache
|
||||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
|
||||||
|
- name: Download and setup SonarScanner
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/.sonar
|
||||||
|
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
|
||||||
|
unzip -q sonar-scanner-cli-5.0.1.3006-linux.zip -d $HOME/.sonar/
|
||||||
|
echo "$HOME/.sonar/sonar-scanner-5.0.1.3006-linux/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Verify Java version
|
||||||
|
run: java -version
|
||||||
|
|
||||||
|
- name: SonarQube Scan
|
||||||
|
env:
|
||||||
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
sonar-scanner \
|
||||||
|
-Dsonar.projectKey=${{ github.event.repository.name }} \
|
||||||
|
-Dsonar.sources=. \
|
||||||
|
-Dsonar.host.url=${SONAR_HOST_URL} \
|
||||||
|
-Dsonar.token=${SONAR_TOKEN}
|
||||||
Reference in New Issue
Block a user