Skip to content

added kafka connectivity to aiven #26

added kafka connectivity to aiven

added kafka connectivity to aiven #26

name: Sonar Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
jobs:
sonarcloud_scan:
name: Build and Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Fetch depth 0 is crucial for SonarCloud to analyze all code history
# and correctly compute 'New Code' metrics, especially for PRs.
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle and Run Sonar Analysis
env:
# The SONAR_TOKEN secret is used for authentication with SonarCloud
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
# The './gradlew clean build jacocoTestReport' command ensures all tests run
# and the JaCoCo coverage report is created *before* the SonarScanner runs.
./gradlew clean build jacocoTestReport sonar