add gate
Some checks failed
SonarQube / Build and analyze (pull_request) Failing after 2m56s

This commit is contained in:
Leonid Pershin
2025-10-22 03:40:18 +03:00
parent 0e5c418a0e
commit d9151105e8
2 changed files with 27 additions and 1 deletions

View File

@@ -51,4 +51,24 @@ jobs:
echo "Running tests with coverage..." echo "Running tests with coverage..."
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage/ /p:Exclude="[*]*.Migrations.*" /p:ExcludeByFile="**/Migrations/*.cs" dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage/ /p:Exclude="[*]*.Migrations.*" /p:ExcludeByFile="**/Migrations/*.cs"
echo "Ending SonarQube analysis..." echo "Ending SonarQube analysis..."
~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" ~/.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

View File

@@ -4,6 +4,12 @@
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE.txt) [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE.txt)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14+-blue)](https://www.postgresql.org/) [![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. Интеллектуальный Telegram-бот на базе локальных AI моделей (Ollama), построенный на .NET 9 с использованием Clean Architecture.
## ✨ Основные возможности ## ✨ Основные возможности