ONECOND-2339 Implement SonarQube for SAST #229
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
on: | |
push: | |
branches: [ main, release* ] | |
pull_request: | |
branches: [ main, release* ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get source | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Step to set up JDK 1.8 for building the project | |
- name: Set up JDK 1.8 | |
id: setup-java-8 | |
uses: actions/setup-java@v1 | |
with: | |
distribution: adopt | |
java-version: 1.8 | |
# Use JDK 8 for Gradle build (compile) | |
- name: Build with Gradle | |
run: JAVA_HOME="${{ steps.setup-java-8.outputs.path }}" ./gradlew build -x test | |
env: | |
GIT_USER: ${{ secrets.AM_GPR_USER }} | |
GIT_TOKEN: ${{ secrets.DELUXE_ORG_GPR_TOKEN }} | |
# Step to set up JDK 11 for running SonarQube scan | |
- name: Setup JDK 11 | |
id: setup-java-11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: adopt | |
java-version: 11 | |
# Use JDK 11 for SonarQube analysis | |
- name: Run SonarScanner | |
run: JAVA_HOME="${{ steps.setup-java-11.outputs.path }}" ./gradlew sonarqube -x test -Dsonar.verbose=true -Dsonar.projectKey=conductor -Dsonar.host.url=https://sonarqube.dmlib.de -Dsonar.login=${{ secrets.DELUXE_ORG_SONAR_TOKEN }} | |
env: | |
GIT_USER: ${{ secrets.AM_GPR_USER }} | |
GIT_TOKEN: ${{ secrets.DELUXE_ORG_GPR_TOKEN }} |