Enabling sonarcloud on testing workflow job
@@ -52,4 +52,22 @@ jobs:
run: tools/bin/syndesis build -m s2i --image --flash --docker
- name: Run integration tests
run: tools/bin/syndesis integration-test --s2i --logging
+ # Send SonarCloud statistics
+ - name: Set up JDK 11 for SonarCloud
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ - name: Install Java 11
+ env:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ if: ${{env.SONAR_TOKEN != ''}}
+ uses: AdoptOpenJDK/install-jdk@v1
+ with:
+ version: '11'
+ - name: Send analysis to SonarCloud
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ if: ${{env.SONAR_TOKEN != ''}}
+ run: cd app; ./mvnw -q -B -pl '!:extension-bom,!:integration-bom' jacoco:report && ./mvnw -B -N -Dsonar.login=${{secrets.SONAR_TOKEN}} sonar:sonar -Dsonar.sources=$(find . -wholename "*/src/main/java" | sed -z 's/\n/,/g;s/,$/\n/') -Dsonar.java.binaries=$(find . -wholename "*/target/classes" | sed -z 's/\n/,/g;s/,$/\n/')
