Skip to content

chore: add sonar qube scan to project #7

chore: add sonar qube scan to project

chore: add sonar qube scan to project #7

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@v4
- 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') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests with coverage
run: |
poetry run pytest --cov=src --cov-report=xml --cov-report=term
continue-on-error: true
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6.0.0
with:
args: >
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
-Dsonar.organization=${{ secrets.SONAR_ORG }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}