Skip to content

Analyze with SonarCloud #129

Analyze with SonarCloud

Analyze with SonarCloud #129

Workflow file for this run

name: Analyze with SonarCloud
on:
workflow_run:
workflows:
- Oppia Mobile Export CI
types:
- completed
secrets: inherit
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v2
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- run: git branch
- run: env
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: sonarcloud_coverage
path: moodle/blocks/oppia_mobile_export/build/coverage-behat/
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.sources=.
-Dsonar.php.coverage.reportPaths=/moodle/blocks/oppia_mobile_export/build/coverage-behat/coverage.xml
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
-Dsonar.pullrequest.key=${{ github.event.workflow_run.pull_requests[0].number }}
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.pull_requests[0].head.ref }}
-Dsonar.pullrequest.base=${{ github.event.workflow_run.pull_requests[0].base.ref }}