Skip to content

chore: add sonar qube scan to project #5

chore: add sonar qube scan to project

chore: add sonar qube scan to project #5

Workflow file for this run

name: SAST com SonarCloud
on:
push:
branches: [main]
pull_request:
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v5.0.0
with:
args: >
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.organization=${{ secrets.SONAR_ORG }}
-Dsonar.sources=src
-Dsonar.exclusions=**/*test*.py,**/conftest.py
-Dsonar.python.version=3.12
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io