Update sonarqube workflow to use new composite action
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
49
.github/workflows/sonarqube.yml
vendored
49
.github/workflows/sonarqube.yml
vendored
@@ -8,30 +8,27 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
prdetails:
|
||||
name: PR Details
|
||||
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
|
||||
uses: matrix-org/matrix-js-sdk/.github/workflows/pr_details.yml@develop
|
||||
with:
|
||||
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
|
||||
sonarqube:
|
||||
name: 🩻 SonarQube
|
||||
needs: prdetails
|
||||
# Only wait for prdetails if it isn't skipped
|
||||
if: |
|
||||
always() &&
|
||||
(needs.prdetails.result == 'success' || needs.prdetails.result == 'skipped') &&
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
uses: matrix-org/matrix-js-sdk/.github/workflows/sonarcloud.yml@develop
|
||||
with:
|
||||
repo: ${{ github.event.workflow_run.head_repository.full_name }}
|
||||
pr_id: ${{ needs.prdetails.outputs.pr_id }}
|
||||
head_branch: ${{ needs.prdetails.outputs.head_branch || github.event.workflow_run.head_branch }}
|
||||
base_branch: ${{ needs.prdetails.outputs.base_branch }}
|
||||
revision: ${{ github.event.workflow_run.head_sha }}
|
||||
coverage_workflow_name: tests.yml
|
||||
coverage_run_id: ${{ github.event.workflow_run.id }}
|
||||
secrets:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
name: SonarQube
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.workflow_run.head_repository.full_name }}
|
||||
ref: ${{ github.event.workflow_run.head_branch }} # checkout commit that triggered this workflow
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- uses: matrix-org/setup-python-poetry@v1
|
||||
- name: Read Synapse version
|
||||
id: version
|
||||
run: echo "::set-output name=current-version::$(poetry version --short)"
|
||||
- name: SonarCloud Scan
|
||||
uses: matrix-org/sonarcloud-workflow-action@v1
|
||||
with:
|
||||
is_pr: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
|
||||
version: ${{ steps.version.outputs.current-version }}
|
||||
branch: ${{ github.event.workflow_run.head_branch }}
|
||||
revision: ${{ github.event.workflow_run.head_sha }}
|
||||
token: ${{ secrets.SONAR_TOKEN }}
|
||||
coverage_run_id: ${{ github.event.workflow_run.id }}
|
||||
coverage_workflow_name: tests.yml
|
||||
|
||||
Reference in New Issue
Block a user