Skip to content

Commit

Permalink
Revert "Add SonarQube analysis"
Browse files Browse the repository at this point in the history
This reverts commit d7fb7dd.
  • Loading branch information
durimkryeziu committed Nov 9, 2024
1 parent d7fb7dd commit f0af162
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 43 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened]

jobs:
build:
Expand All @@ -15,41 +14,22 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Setup & Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run PMD Analysis
run: ./gradlew pmdMain pmdTest
continue-on-error: false # Fail if code quality issues are found

- name: Run Unit Tests
run: ./gradlew test

- name: Build Project
run: ./gradlew build -x test

- name: Run PMD Analysis
run: ./gradlew pmdMain pmdTest
continue-on-error: false # Fail if code quality issues are found

- name: Run Sonar Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar --info
run: ./gradlew build
4 changes: 0 additions & 4 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ plugins {
repositories {
gradlePluginPortal()
}

dependencies {
implementation(libs.sonarqube.gradle.plugin)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'java'
id 'pmd'
id "org.sonarqube"
}

repositories {
Expand Down Expand Up @@ -29,11 +28,3 @@ pmd {
"category/java/bestpractices.xml",
"category/java/performance.xml"]
}

sonar {
properties {
property "sonar.projectKey", "durimkryeziu_exercises-for-programmers-java"
property "sonar.organization", "durimkryeziu"
property "sonar.host.url", "https://sonarcloud.io"
}
}
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
[versions]
assertj-core = "3.26.3"
javafxplugin = "0.1.0"
junit-jupiter = "5.11.0"
javafxplugin = "0.1.0"
pmd = "7.6.0"
sonarqube = "5.1.0.4882"

[libraries]
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
sonarqube-gradle-plugin = { module = "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin", version.ref = "sonarqube" }

[plugins]
javafxplugin = { id = "org.openjfx.javafxplugin", version.ref = "javafxplugin" }

0 comments on commit f0af162

Please sign in to comment.