diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 6f4ae68..76c38bc 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -51,4 +51,24 @@ jobs: echo "Running tests with coverage..." dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage/ /p:Exclude="[*]*.Migrations.*" /p:ExcludeByFile="**/Migrations/*.cs" echo "Ending SonarQube analysis..." - ~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + ~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + - name: Wait for Quality Gate + run: | + echo "Waiting for SonarQube Quality Gate result..." + sleep 10 + + # Get Quality Gate status + QUALITY_GATE_STATUS=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \ + "${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=ChatBot" \ + | grep -o '"status":"[^"]*"' | cut -d'"' -f4) + + echo "Quality Gate Status: $QUALITY_GATE_STATUS" + + if [ "$QUALITY_GATE_STATUS" != "OK" ]; then + echo "❌ Quality Gate failed! Status: $QUALITY_GATE_STATUS" + echo "Please check the SonarQube dashboard for details:" + echo "${{ secrets.SONAR_HOST_URL }}/dashboard?id=ChatBot" + exit 1 + else + echo "✅ Quality Gate passed!" + fi \ No newline at end of file diff --git a/README.md b/README.md index 196af14..f0cc1dd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE.txt) [![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14+-blue)](https://www.postgresql.org/) +[![Quality Gate Status](https://sonarqube.api.home/api/project_badges/measure?project=ChatBot&metric=alert_status)](https://sonarqube.api.home/dashboard?id=ChatBot) +[![Coverage](https://sonarqube.api.home/api/project_badges/measure?project=ChatBot&metric=coverage)](https://sonarqube.api.home/dashboard?id=ChatBot) +[![Bugs](https://sonarqube.api.home/api/project_badges/measure?project=ChatBot&metric=bugs)](https://sonarqube.api.home/dashboard?id=ChatBot) +[![Vulnerabilities](https://sonarqube.api.home/api/project_badges/measure?project=ChatBot&metric=vulnerabilities)](https://sonarqube.api.home/dashboard?id=ChatBot) +[![Code Smells](https://sonarqube.api.home/api/project_badges/measure?project=ChatBot&metric=code_smells)](https://sonarqube.api.home/dashboard?id=ChatBot) + Интеллектуальный Telegram-бот на базе локальных AI моделей (Ollama), построенный на .NET 9 с использованием Clean Architecture. ## ✨ Основные возможности