-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ZCH-66): cleanup sonar scan and quality gate steps (#84)
* feat(ZCH-66): pass working dir * fix: fix basedir * fix: update step * chore: simplify pipeline * chore: change default * chore: remove deprecated code * chore: add var for quality gate * chore: restore old sonar flutter * chore: remove old vars * chore: rename to flutter
- Loading branch information
1 parent
119a6b8
commit 4881e51
Showing
7 changed files
with
78 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Sonar analyze with artifacts | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
LABELS: | ||
required: true | ||
type: string | ||
WORKING_DIRECTORY: | ||
required: true | ||
type: string | ||
SONAR_IMAGE: | ||
required: false | ||
type: string | ||
default: "sonarsource/sonar-scanner-cli" | ||
SONAR_HOST_URL: | ||
required: false | ||
type: string | ||
default: "https://sonarqube.zupit.software" | ||
DOWNLOAD_ARTIFACT: | ||
required: false | ||
type: boolean | ||
default: true | ||
ARTIFACT_FILENAME: | ||
required: false | ||
type: string | ||
default: "" | ||
ARTIFACT_PATH: | ||
required: false | ||
type: string | ||
default: ".coverage-reports/" | ||
PRE_SCAN_COMMANDS: | ||
required: false | ||
type: string | ||
default: "" | ||
CHECK_QUALITY_GATE: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
|
||
jobs: | ||
sonar-analyze: | ||
runs-on: ${{ fromJson(inputs.LABELS) }} | ||
container: ${{ inputs.SONAR_IMAGE }} | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.WORKING_DIRECTORY }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download coverage artifact | ||
if: ${{ inputs.DOWNLOAD_ARTIFACT }} | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{inputs.ARTIFACT_FILENAME}} | ||
path: ${{ inputs.WORKING_DIRECTORY }}/${{ inputs.ARTIFACT_PATH }} | ||
|
||
- name: Run PRE_SCAN_COMMANDS commands | ||
if: ${{ inputs.PRE_SCAN_COMMANDS != '' }} | ||
run: ${{ inputs.PRE_SCAN_COMMANDS }} | ||
|
||
- name: Run Sonar | ||
run: sonar-scanner -Dsonar.host.url=${{ inputs.SONAR_HOST_URL }} -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dsonar.qualitygate.wait=${{ inputs.CHECK_QUALITY_GATE }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
docker buildx build -t ghcr.io/zupit-it/pipeline-templates/flutter-sonar-scanner-cli:5.0.1 -t ghcr.io/zupit-it/pipeline-templates/flutter-sonar-scanner-cli:latest -f Dockerfile . | ||
docker push ghcr.io/zupit-it/pipeline-templates/flutter-sonar-scanner-cli:5.0.1 | ||
docker push ghcr.io/zupit-it/pipeline-templates/flutter-sonar-scanner-cli:latest |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.