Skip to content

Commit

Permalink
Merge pull request #115 from 12urenloop/fix-ci
Browse files Browse the repository at this point in the history
update CI
  • Loading branch information
FKD13 authored Mar 25, 2024
2 parents b107fdb + 6670b8a commit a5867e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 61 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
47 changes: 0 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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)
Expand All @@ -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"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package telraam.logic;
package telraam.logic.simple;

import org.jdbi.v3.core.Jdbi;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -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;
Expand Down

0 comments on commit a5867e8

Please sign in to comment.