Skip to content

task(ci): add sonar #175

task(ci): add sonar

task(ci): add sonar #175

Workflow file for this run

---
name: Code Coverage Check
on:
push:
branches:
- PSCE-262
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Set up poetry and install
uses: ./.github/actions/setup-poetry
with:
python-version: "3.9"
- name: Run tests
run: make test-code-cov
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.xml
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Get coverage
uses: actions/download-artifact@v2
with:
name: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.python.coverage.reportPaths=coverage.xml
-Dsonar.tests=tests/
-Dsonar.sources=trestlebot/
-Dsonar.python.version=3.10
-Dsonar.projectKey=rh-psce_trestle-bot
-Dsonar.organization=rh-psce
- name: 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 }}