name: SonarQube Scan on: push: branches: - main jobs: sonarqube: name: SonarQube Analysis runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.23' cache: true - name: Run tests with coverage run: go test -v -coverprofile=coverage.out ./src - name: Run SonarQube scanner uses: SonarSource/sonarqube-scan-action@v7.1.0 env: SONAR_HOST_URL: ${{ secrets.SONAR_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}