Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CI #115

Merged
merged 4 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading