Skip to content

Commit 66e3fe0

Browse files
committed
chore: add sonar qube scan to project
1 parent f88e4d0 commit 66e3fe0

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: SAST com SonarCloud
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
sonarcloud:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Cache pip dependencies
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.cache/pip
24+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
31+
- name: Run SonarCloud Scan
32+
uses: SonarSource/sonarqube-scan-action@v6.0.0
33+
with:
34+
args: >
35+
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT }}
36+
-Dsonar.organization=${{ secrets.SONAR_ORG }}
37+
env:
38+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39+
SONAR_HOST_URL: https://sonarcloud.io

sonar-project.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sonar.sources=src
2+
sonar.exclusions=**/*test*.py,**/conftest.py
3+
sonar.python.version=3.12
4+

0 commit comments

Comments
 (0)