-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added sonarscan workflow. * added sonarscan workflow with html output format. * added sonar properties with html output format. * renamed sonar-project.properties. * Reverted renaming sonar-project.properties. --------- Co-authored-by: Raj Burnwal <[email protected]>
- Loading branch information
1 parent
d27d1a1
commit 0f216ea
Showing
2 changed files
with
88 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Run Pebblo Scanner Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '30 2,14 * * *' | ||
|
||
workflow_dispatch: # Activate this workflow manually | ||
env: | ||
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11.x' }} | ||
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | ||
SLACK_CH: ${{ secrets.SLACK_CH }} | ||
jobs: | ||
Setup_Pebblo_Run_Tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
ref: 'main' | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Build Pebblo | ||
run: | | ||
pip install build | ||
python -m build --wheel | ||
ls -la dist/ | ||
- name: Install Pebblo Packages | ||
run: | | ||
echo 'Install Pebblo Package' | ||
pkg_file=$(ls dist | grep .whl) | ||
pip3 install dist/$pkg_file --force-reinstall | ||
pip3 install --upgrade pip | ||
- name: SonarCloud Scan | ||
id: sonarqube-scan-check | ||
uses: SonarSource/[email protected] | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
# - name: SonarQube Quality Gate check | ||
# id: sonarqube-quality-gate-check | ||
# uses: sonarsource/sonarqube-quality-gate-action@master | ||
# # Force to fail step after specific time. | ||
# timeout-minutes: 5 | ||
# env: | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
|
||
- name: Install Sonar Report and generate | ||
id: sonar-report-gen | ||
run: | | ||
echo 'Installing sonar-report NPM package.' | ||
npm install -g sonar-report | ||
sonar-report \ | ||
--sonarurl="https://sonarcloud.io" \ | ||
--sonarcomponent="daxa-ai_pebblo" \ | ||
--sonarorganization="daxa-ai" \ | ||
--project="daxa-ai_pebblo" \ | ||
--application="sonar-report" \ | ||
--release="1.0.0" \ | ||
--branch="main" \ | ||
--output="./pebblo_sonar.html" \ | ||
--sonartoken ${{ secrets.SONAR_TOKEN }} | ||
- name: Upload Pebblo SonarQube report File | ||
if: steps.sonar-report-gen.outcome == 'success' | ||
run: | | ||
curl -F file=@pebblo_sonar.html https://slack.com/api/files.upload -H "Authorization: Bearer $SLACK_TOKEN" -F channels=$SLACK_CH -F "initial_comment=Pebblo Sonar Scan Report" | ||
- name: Report Status if sonarscanner failure | ||
if: ${{ always() }} || steps.sonarqube-scan-check.outcome == 'failure' | ||
uses: ravsamhq/notify-slack-action@master | ||
with: | ||
status: ${{ job.status }} | ||
notify_when: 'failure' | ||
message_format: "{emoji} *{workflow}* {status_message} with Scan status ${{ steps.sonarqube-scan-check.outcome }}" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SECRET }} |
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,4 @@ | ||
sonar.projectKey=daxa-ai_pebblo | ||
sonar.organization=daxa-ai | ||
sonar.python.version=3 | ||
sonar.dynamicAnalysis=reuseReports |