diff --git a/.github/workflows/quality-check-repository.yml b/.github/workflows/quality-check-repository.yml index 47f5a2873..4a226b2b6 100644 --- a/.github/workflows/quality-check-repository.yml +++ b/.github/workflows/quality-check-repository.yml @@ -1,4 +1,4 @@ -name: "[SonarQube] Quality Check" +name: "[SonarCloud] Quality Check" on: workflow_dispatch: @@ -9,19 +9,74 @@ on: - 'app/**' - 'cleaner/**' - 'repo-cloner/**' + pull_request: + types: [opened, synchronize, reopened] jobs: - build: - name: Build and analyze + app-api: + name: app-api runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: app/api + + app-ui: + name: app-ui + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: app/ui + + cleaner: + name: cleaner + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - - uses: sonarsource/sonarqube-scan-action@v3 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_INT }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL_INT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: cleaner/ + + repo-cloner: + name: repo-cloner + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: repo-cloner/ diff --git a/app/api/sonar-project.properties b/app/api/sonar-project.properties new file mode 100644 index 000000000..d05529c82 --- /dev/null +++ b/app/api/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=kdl-server_app-api +sonar.organization=konstellation-io +sonar.projectName=kdl-server-app-api diff --git a/app/ui/sonar-project.properties b/app/ui/sonar-project.properties new file mode 100644 index 000000000..28e644335 --- /dev/null +++ b/app/ui/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=kdl-server_app-ui +sonar.organization=konstellation-io +sonar.projectName=kdl-server-app-ui diff --git a/cleaner/sonar-project.properties b/cleaner/sonar-project.properties new file mode 100644 index 000000000..1143e80aa --- /dev/null +++ b/cleaner/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=kdl-server_cleaner +sonar.organization=konstellation-io +sonar.projectName=kdl-server-cleaner diff --git a/repo-cloner/sonar-project.properties b/repo-cloner/sonar-project.properties new file mode 100644 index 000000000..1a70be750 --- /dev/null +++ b/repo-cloner/sonar-project.properties @@ -0,0 +1,3 @@ +sonar.projectKey=kdl-server_repo-cloner +sonar.organization=konstellation-io +sonar.projectName=kdl-server-repo-cloner diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index f84579224..000000000 --- a/sonar-project.properties +++ /dev/null @@ -1 +0,0 @@ -sonar.projectKey=kdl-server