Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/sonarqube-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: SonarQube Analysis

on:
pull_request:
push:
branches: ["**"]

jobs:
sonar:
name: Run SonarQube Analysis
runs-on: self-hosted

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "zulu"

- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar-cache
restore-keys: ${{ runner.os }}-sonar-cache

- name: Download SonarScanner CLI
run: |
mkdir -p .sonar/cli
curl -sSLo sonar.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
unzip sonar.zip -d .sonar/cli
mv .sonar/cli/sonar-scanner-* .sonar/cli/sonar-scanner

- name: Run SonarScanner
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: |
.sonar/cli/sonar-scanner/bin/sonar-scanner \
-Dsonar.host.url="$SONAR_HOST_URL" \
-Dsonar.login="$SONAR_TOKEN"
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sonar.projectKey=AltaPay_sdk-csharp2.0_b6c5ab47-9b9b-4f42-a497-caf45e745b6b
sonar.projectBaseDir=AltaPayApi
sonar.coverage.exclusions=**