name: SonarQube on: schedule: - cron: '0 2 * * *' workflow_dispatch: jobs: sonarqube: runs-on: ubuntu-latest container: image: gitea.siegeln.net/cameleer/cameleer-build:1 credentials: username: cameleer password: ${{ secrets.REGISTRY_TOKEN }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Configure Gitea Maven Registry run: | mkdir -p ~/.m2 cat > ~/.m2/settings.xml << 'SETTINGS' gitea cameleer ${env.REGISTRY_TOKEN} SETTINGS env: REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} - name: Cache Maven dependencies uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-maven- - name: Build and Test with coverage run: mvn clean verify -DskipITs -U --batch-mode - name: SonarQube Analysis run: | mvn sonar:sonar --batch-mode \ -Dsonar.host.url="$SONAR_HOST_URL" \ -Dsonar.token="$SONAR_TOKEN" \ -Dsonar.projectKey=cameleer3-server \ -Dsonar.projectName="Cameleer3 Server" env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}