π Update public repo stats [automated] #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarQube | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| sonarqube: | |
| name: SonarQube Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies (best effort) | |
| continue-on-error: true | |
| run: | | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f pyproject.toml ]; then pip install . || true; fi | |
| pip install coverage pytest || true | |
| - name: Run tests with coverage (best effort) | |
| continue-on-error: true | |
| run: | | |
| if [ -d tests ] || [ -d test ]; then | |
| coverage run -m pytest || true | |
| coverage xml -o coverage.xml || true | |
| fi | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v5 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |