From 8ba54fd6368bbb962c12c6f04dbc9552caf82723 Mon Sep 17 00:00:00 2001 From: FKD13 <44001949+FKD13@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:22:44 +0100 Subject: [PATCH 1/4] update workflow --- .github/workflows/gradle.yml | 24 +++++++++---------- .../logic/{ => simple}/SimpleLapperTest.java | 3 ++- 2 files changed, 13 insertions(+), 14 deletions(-) rename src/test/java/telraam/logic/{ => simple}/SimpleLapperTest.java (97%) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 40e55a9..c9a2b1b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -16,26 +16,24 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 16 + + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 16 - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar + java-version: 17 + - name: Cache Gradle packages uses: actions/cache@v1 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle + - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew build sonarqube --info + + - name: Build + run: ./gradlew build + + - name: Build + run: ./gradlew test diff --git a/src/test/java/telraam/logic/SimpleLapperTest.java b/src/test/java/telraam/logic/simple/SimpleLapperTest.java similarity index 97% rename from src/test/java/telraam/logic/SimpleLapperTest.java rename to src/test/java/telraam/logic/simple/SimpleLapperTest.java index 7758c47..838397f 100644 --- a/src/test/java/telraam/logic/SimpleLapperTest.java +++ b/src/test/java/telraam/logic/simple/SimpleLapperTest.java @@ -1,4 +1,4 @@ -package telraam.logic; +package telraam.logic.simple; import org.jdbi.v3.core.Jdbi; import org.junit.jupiter.api.BeforeEach; @@ -8,6 +8,7 @@ import telraam.database.models.Detection; import telraam.database.models.Lap; import telraam.database.models.LapSource; +import telraam.logic.Lapper; import telraam.logic.simple.SimpleLapper; import java.sql.Timestamp; From d105b63cbed7d65e5978c7bef64f228d2670937a Mon Sep 17 00:00:00 2001 From: FKD13 <44001949+FKD13@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:29:48 +0100 Subject: [PATCH 2/4] remove sonarqube --- .github/workflows/gradle.yml | 2 +- build.gradle | 44 ------------------------------------ 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c9a2b1b..d4fe08a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -35,5 +35,5 @@ jobs: - name: Build run: ./gradlew build - - name: Build + - name: Test run: ./gradlew test diff --git a/build.gradle b/build.gradle index 5269053..dd78f2d 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,6 @@ import org.flywaydb.gradle.task.FlywayMigrateTask plugins { id 'java' id 'application' - id 'jacoco' - id 'org.sonarqube' version "3.0" id 'idea' id 'org.flywaydb.flyway' version "8.0.0" } @@ -88,42 +86,7 @@ test { jacocoTestReport } } -jacoco { - toolVersion = "0.8.7" - reportsDirectory = layout.buildDirectory.dir('coverage').get() -} -jacocoTestReport { - dependsOn { - test - } - reports { - xml.required = true - } - afterEvaluate { - classDirectories.setFrom files(classDirectories.files.collect { - fileTree(dir: it, exclude: [ - '**/database/models/**' - ]) - }) - } -} -jacocoTestCoverageVerification { - afterEvaluate { - classDirectories.setFrom files(classDirectories.files.collect { - fileTree(dir: it, exclude: [ - '**/database/models/**' - ]) - }) - } - violationRules { - rule { - limit { - minimum = 0.7 - } - } - } -} def prodProps = new Properties() file("$rootProject.projectDir/src/main/resources/telraam/prodConfig.properties").withInputStream { prodProps.load(it) @@ -150,10 +113,3 @@ task migrateTestingDatabase(type: FlywayMigrateTask) { url = testProps.getProperty("DB_URL") baselineOnMigrate = true } -sonarqube { - properties { - property "sonar.projectKey", "12urenloop_Telraam" - property "sonar.organization", "12urenloop" - property "sonar.host.url", "https://sonarcloud.io" - } -} From 991c8f398be702f5031cbfc3ad92461e721651f5 Mon Sep 17 00:00:00 2001 From: FKD13 <44001949+FKD13@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:36:15 +0100 Subject: [PATCH 3/4] forgot a reference --- build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.gradle b/build.gradle index dd78f2d..d1a3b42 100644 --- a/build.gradle +++ b/build.gradle @@ -82,9 +82,6 @@ test { testLogging { events "passed", "skipped", "failed" } - finalizedBy { - jacocoTestReport - } } def prodProps = new Properties() From 6670b8aac0f688e0961e6e2e2a2afb6872a29b7d Mon Sep 17 00:00:00 2001 From: FKD13 <44001949+FKD13@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:43:08 +0100 Subject: [PATCH 4/4] different gradle commands --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index d4fe08a..f45a655 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -33,7 +33,7 @@ jobs: run: chmod +x gradlew - name: Build - run: ./gradlew build + run: ./gradlew compileJava compileTestJava - name: Test run: ./gradlew test