description: "Gerrit refspec of change"
required: true
type: string
+ secrets:
+ SONAR_TOKEN:
+ description: "Sonar Cloud access token"
+ required: true
concurrency:
# yamllint disable-line rule:line-length
group: gerrit-merge-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
cancel-in-progress: true
-permissions: read-all
-
jobs:
notify:
runs-on: ubuntu-latest
- name: Allow replication
run: sleep 10s
- call-gerrit-tox-sonarcloud:
+ call-gerrit-tox-and-sonarcloud:
+ runs-on: ubuntu-latest
needs: notify
- # yamllint disable-line rule:line-length
- uses: lfit/releng-reusable-workflows/.github/workflows/composed-tox-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 }}
- TOX_ENVS: '["py3"]'
- SONAR_PROJECT_KEY: "o-ran-sc_com-pylog"
- SONAR_ORG: "o-ran-sc"
- SONAR_ARGS: >
- -Dsonar.sources=mdclogpy
- -Dsonar.python.coverage.reportPaths=./coverage.xm
- -Dsonar.verbose=true
- secrets:
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ steps:
+ - name: Run Tox verify
+ # yamllint disable-line rule:line-length
+ uses: lfit/releng-reusable-workflows/.github/workflows/gerrit-compose-required-tox-verify.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 }}
+ TOX_ENVS: '["py3"]'
+ - name: Run SonarCloud Scan
+ uses: sonarsource/sonarcloud-github-action@master
+ env:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ with:
+ args:
+ SONAR_PROJECT_KEY: "o-ran-sc_com-pylog"
+ SONAR_ORG: "o-ran-sc"
+ SONAR_ARGS: >
+ -Dsonar.build.sourceEncoding=UTF-8
+ -Dsonar.organization=o-ran-sc
+ -Dsonar.projectBaseDir=.
+ -Dsonar.projectKey=o-ran-sc_com-pylog
+ -Dsonar.projectName=com-pylog
+ -Dsonar.python.coverage.reportPaths=./coverage.xm
+ -Dsonar.sources=mdclogpy
+ -Dsonar.verbose=true
+ secrets:
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
report-status:
if: ${{ always() }}