mirror of https://github.com/gmbrax/Pilgrim.git
Update pylint_sonarqube.yml
Fix the ruff error on the sonarcloud scan
This commit is contained in:
parent
cc68bbcf2e
commit
78e45e26fd
|
|
@ -1,5 +1,4 @@
|
||||||
name: Pylint and SonarCloud
|
name: Pylint and SonarCloud
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, master, staging ]
|
branches: [ main, master, staging ]
|
||||||
|
|
@ -12,13 +11,14 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10"]
|
python-version: ["3.10"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Needed for SonarCloud
|
fetch-depth: 0 # Necessário para SonarCloud
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
|
@ -30,11 +30,11 @@ jobs:
|
||||||
|
|
||||||
- name: Analysing the code with pylint (console output)
|
- name: Analysing the code with pylint (console output)
|
||||||
run: |
|
run: |
|
||||||
pylint --disable=C0114,C0115,C0116 --exit-zero $(git ls-files '*.py')
|
pylint --disable=C0114,C0115,C0116 --exit-zero $(git ls-files '*.py') || true
|
||||||
|
|
||||||
- name: Generate Pylint report for SonarCloud
|
- name: Generate Pylint report for SonarCloud
|
||||||
run: |
|
run: |
|
||||||
pylint --disable=C0114,C0115,C0116 --output-format=json --exit-zero $(git ls-files '*.py') > pylint-report.json
|
pylint --disable=C0114,C0115,C0116 --output-format=json --exit-zero $(git ls-files '*.py') > pylint-report.json || true
|
||||||
|
|
||||||
- name: Run Ruff
|
- name: Run Ruff
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -44,11 +44,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
if [ -d "tests" ] || [ -f "test_*.py" ] || [ -f "*_test.py" ]; then
|
if [ -d "tests" ] || [ -f "test_*.py" ] || [ -f "*_test.py" ]; then
|
||||||
coverage run -m pytest || true
|
coverage run -m pytest || true
|
||||||
coverage xml
|
coverage xml || true
|
||||||
|
else
|
||||||
|
echo "No tests found, skipping coverage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: SonarCloud Scan
|
- name: SonarCloud Scan
|
||||||
uses: SonarSource/sonarcloud-github-action@master
|
uses: SonarSource/sonarqube-scan-action@v5.0.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
@ -57,6 +59,5 @@ jobs:
|
||||||
-Dsonar.projectKey=gmbrax_Pilgrim
|
-Dsonar.projectKey=gmbrax_Pilgrim
|
||||||
-Dsonar.organization=gmbrax
|
-Dsonar.organization=gmbrax
|
||||||
-Dsonar.python.pylint.reportPaths=pylint-report.json
|
-Dsonar.python.pylint.reportPaths=pylint-report.json
|
||||||
|
-Dsonar.python.ruff.reportPaths=ruff-report.json
|
||||||
-Dsonar.python.coverage.reportPaths=coverage.xml
|
-Dsonar.python.coverage.reportPaths=coverage.xml
|
||||||
-Dsonar.python.ruff.reportPaths=ruff-report.json
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue