Skip to content

update cloudwatch dashboard (#302) #17

update cloudwatch dashboard (#302)

update cloudwatch dashboard (#302) #17

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
paths:
- "**/src/**"
- "**pom.xml"
- ".github/workflows/code-review.yml"
pull_request_target:
types:
- opened
- edited
- synchronize
paths:
- "**/src/**"
- "**pom.xml"
- ".github/workflows/code-review.yml"
jobs:
build:
runs-on: ubuntu-22.04
env:
AWS_REGION: eu-south-1
AWS_ACCESS_KEY_ID: dummy
AWS_SECRET_KEY: dummy
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Set up JDK 21
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '21'
- name: Prepare SonarCloud analysis configuration
run: >
mvn -Bclean verify
-f src/oneid/pom.xml
-P oneid-all
-DpublishJUnitResults=true
-DjavaHomeOption='JDKVersion'
-DmavenVersionOption='Default'
-DtestResultsFiles='**/surefire-reports/TEST-*.xml'
-DmavenAuthenticateFeed=false
-DeffectivePomSkip=false
-DsonarQubeRunAnalysis=false
- name: finding jacoco.xml
run: |
xmlReportPaths=$(find "$(pwd)" -path '*jacoco.xml' | sed 's/.*/&/' | tr '\n' ','); echo "##vso[task.setvariable variable=xmlReportPaths]$xmlReportPaths"
- name: Analyze with SonarCloud
#todo add ignored files
# todo use the variable $xmlReportPaths for the assignment of line 59
run: >
mvn -B sonar:sonar
-f src/oneid/pom.xml
-P oneid-all
-Dsonar.coverage.jacoco.xmlReportPaths="/home/runner/work/oneidentity/oneidentity/src/oneid/target/coverage/jacoco.xml"
-Dsonar.projectName=$SONARCLOUD_PROJECT_NAME
-Dsonar.projectKey=$SONARCLOUD_PROJECT_KEY
-Dsonar.organization=pagopa
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONARCLOUD_PROJECT_KEY: ${{ vars.SONARCLOUD_PROJECT_KEY }}
SONARCLOUD_PROJECT_NAME: ${{ vars.SONARCLOUD_PROJECT_NAME }}