Files
TK-BOM-Project/.gitea/workflows/sonarqube.yml
Hyungi Ahn fc925974bb
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Failing after 2m13s
fix: Use actual container IPs for network communication
2025-07-24 12:29:50 +09:00

35 lines
932 B
YAML

name: SonarQube Analysis
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master ]
jobs:
sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
run: |
git clone http://172.17.0.2:3000/${{ gitea.repository }}.git .
- name: Test SonarQube connection
run: |
echo "Testing connection to SonarQube..."
curl -f http://172.17.0.3:9000/api/system/ping || echo "Connection failed"
- name: Run SonarQube scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
docker run \
--rm \
--network bridge \
-e SONAR_HOST_URL="http://172.17.0.3:9000" \
-e SONAR_SCANNER_OPTS="-Dsonar.projectKey=my-project" \
-e SONAR_TOKEN="${SONAR_TOKEN}" \
-v "$(pwd):/usr/src" \
sonarsource/sonar-scanner-cli