diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 40e55a9..f45a655 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 compileJava compileTestJava + + - name: Test + run: ./gradlew test diff --git a/build.gradle b/build.gradle index 5269053..d1a3b42 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" } @@ -84,46 +82,8 @@ test { testLogging { events "passed", "skipped", "failed" } - finalizedBy { - 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 +110,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" - } -} 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;