linter fix #20
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: SonarCloud | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| sonarcloud: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv and deps | |
| run: | | |
| pip install uv | |
| uv sync --frozen | |
| uv pip install pytest pytest-django coverage | |
| - name: Run tests and build coverage.xml (relative paths) | |
| env: | |
| DJANGO_SETTINGS_MODULE: task_manager.settings | |
| SECRET_KEY: test-secret-key | |
| DEBUG: "False" | |
| DATABASE_URL: sqlite:///./test.sqlite3 | |
| ALLOWED_HOSTS: testserver,localhost,127.0.0.1 | |
| SECURE_SSL_REDIRECT: "False" | |
| SESSION_COOKIE_SECURE: "False" | |
| CSRF_COOKIE_SECURE: "False" | |
| run: | | |
| mkdir -p reports | |
| uv run coverage erase | |
| uv run coverage run -m pytest --ds=task_manager.settings --junitxml=reports/junit.xml | |
| uv run coverage xml -i -o coverage.xml # учитывает .coveragerc (relative_files + paths) | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarcloud-github-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |