Skip to content

Commit

Permalink
CI: Add SonarCloud scan GHA workflow
Browse files Browse the repository at this point in the history
Change-Id: Ic0a222751ffb45d1a179707582d3898b7249cf7d
Signed-off-by: Jessica Wagantall <[email protected]>
  • Loading branch information
jwagantall authored and ModeSevenIndustrialSolutions committed Apr 23, 2024
1 parent 257245a commit a0cc224
Showing 1 changed file with 99 additions and 3 deletions.
102 changes: 99 additions & 3 deletions .github/workflows/gerrit-novote-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
steps:
- name: Notify job start
# yamllint disable-line rule:line-length
uses: lfit/gerrit-review-action@7c30179c3c9389545fccb0d458df59879372ae6a # v0.6
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8
with:
host: ${{ vars.GERRIT_SERVER }}
username: ${{ vars.GERRIT_SSH_USER }}
Expand Down Expand Up @@ -101,16 +101,112 @@ jobs:
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

run-maven-sonar-pmproducer:
needs: notify
# yamllint disable-line rule:line-length
uses: lfit/releng-reusable-workflows/.github/workflows/composed-maven-sonar-cloud.yaml@main
with:
GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
# yamllint disable rule:line-length
ENV_VARS: '{"SONARCLOUD_QUALITYGATE_WAIT": "false","SCAN_DEV_BRANCH": "false"}'
ENV_SECRETS: "{}"
JDK_VERSION: "17"
MVN_POM_FILE: "pmproducer/pom.xml"
MVN_PHASES: "clean install"
MVN_OPTS: >-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
-DaltDeploymentRepository=staging::default::file:"${GITHUB_WORKSPACE}"/m2repo
SONAR_PROJECT_KEY: "o-ran-sc_nonrtric-plt-ranpm-pmproducer"
SONAR_ORG: "o-ran-sc"
SONAR_ARGS: >
-Dsonar.verbose=true
-Ddocker.skip=true
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

run-maven-sonar-influxlogger:
needs: notify
# yamllint disable-line rule:line-length
uses: lfit/releng-reusable-workflows/.github/workflows/composed-maven-sonar-cloud.yaml@main
with:
GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
# yamllint disable rule:line-length
ENV_VARS: '{"SONARCLOUD_QUALITYGATE_WAIT": "false","SCAN_DEV_BRANCH": "false"}'
ENV_SECRETS: "{}"
JDK_VERSION: "17"
MVN_POM_FILE: "influxlogger/pom.xml"
MVN_PHASES: "clean install"
MVN_OPTS: >-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
-DaltDeploymentRepository=staging::default::file:"${GITHUB_WORKSPACE}"/m2repo
SONAR_PROJECT_KEY: "o-ran-sc_nonrtric-plt-ranpm-influxlogger"
SONAR_ORG: "o-ran-sc"
SONAR_ARGS: >
-Dsonar.verbose=true
-Ddocker.skip=true
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

run-maven-sonar-datafilecollector:
needs: notify
# yamllint disable-line rule:line-length
uses: lfit/releng-reusable-workflows/.github/workflows/composed-maven-sonar-cloud.yaml@main
with:
GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
# yamllint disable rule:line-length
ENV_VARS: '{"SONARCLOUD_QUALITYGATE_WAIT": "false","SCAN_DEV_BRANCH": "false"}'
ENV_SECRETS: "{}"
JDK_VERSION: "17"
MVN_POM_FILE: "datafilecollector/pom.xml"
MVN_PHASES: "clean install"
MVN_OPTS: >-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
-DaltDeploymentRepository=staging::default::file:"${GITHUB_WORKSPACE}"/m2repo
SONAR_PROJECT_KEY: "o-ran-sc_nonrtric-plt-ranpm-datafilecollector"
SONAR_ORG: "o-ran-sc"
SONAR_ARGS: >
-Dsonar.verbose=true
-Ddocker.skip=true
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

report-status:
if: ${{ always() }}
needs: [notify, call-prescan-sonarcloud]
needs: [notify, call-prescan-sonarcloud, run-maven-sonar-pmproducer, run-maven-sonar-influxlogger, run-maven-sonar-datafilecollector]
runs-on: ubuntu-latest
steps:
- name: Get workflow conclusion
uses: technote-space/workflow-conclusion-action@v3
- name: Report workflow conclusion
# yamllint disable-line rule:line-length
uses: lfit/gerrit-review-action@7c30179c3c9389545fccb0d458df59879372ae6a # v0.6
uses: lfit/gerrit-review-action@9627b9a144f2a2cad70707ddfae87c87dce60729 # v0.8
with:
host: ${{ vars.GERRIT_SERVER }}
username: ${{ vars.GERRIT_SSH_USER }}
Expand Down

0 comments on commit a0cc224

Please sign in to comment.