fix build
This commit is contained in:
@@ -57,10 +57,18 @@ jobs:
|
|||||||
echo "Waiting for SonarQube Quality Gate result..."
|
echo "Waiting for SonarQube Quality Gate result..."
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
# Get Quality Gate status
|
# Get Quality Gate status using jq for proper JSON parsing
|
||||||
QUALITY_GATE_STATUS=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
|
RESPONSE=$(curl -s -u "${{ secrets.SONAR_TOKEN }}:" \
|
||||||
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=ChatBot" \
|
"${{ secrets.SONAR_HOST_URL }}/api/qualitygates/project_status?projectKey=ChatBot")
|
||||||
| grep -o '"status":"[^"]*"' | cut -d'"' -f4)
|
|
||||||
|
echo "API Response: $RESPONSE"
|
||||||
|
|
||||||
|
# Install jq if not available
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
sudo apt-get update && sudo apt-get install -y jq
|
||||||
|
fi
|
||||||
|
|
||||||
|
QUALITY_GATE_STATUS=$(echo "$RESPONSE" | jq -r '.projectStatus.status')
|
||||||
|
|
||||||
echo "Quality Gate Status: $QUALITY_GATE_STATUS"
|
echo "Quality Gate Status: $QUALITY_GATE_STATUS"
|
||||||
|
|
||||||
|
|||||||
40
.gitea/workflows/tests.yml
Normal file
40
.gitea/workflows/tests.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Tests
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Run Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '9.0.x'
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore --verbosity normal
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --configuration Release --no-restore --verbosity normal
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: dotnet test --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx"
|
||||||
|
|
||||||
|
- name: Test Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -f "**/test-results.trx" ]; then
|
||||||
|
echo "✅ Tests completed"
|
||||||
|
else
|
||||||
|
echo "❌ Test results not found"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user