Skip to content

Commit

Permalink
feat: update GitHub workflows and add dependabot support
Browse files Browse the repository at this point in the history
  • Loading branch information
raits authored May 7, 2024
1 parent a287f51 commit 147cb61
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 90 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
groups:
java-minor-patch:
applies-to: version-updates
update-types:
- "minor"
- "patch"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions-minor-patch:
applies-to: version-updates
update-types:
- "minor"
- "patch"
25 changes: 20 additions & 5 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,32 @@ on:
- 'xroad-catalog-lister/src/**'
- 'xroad-catalog-persistence/src/**'
- '.github/**'
permissions:
contents: write # Required for https://github.com/gradle/actions/tree/main/setup-gradle#github-dependency-graph-support
pull-requests: write # https://github.com/gradle/actions/tree/main/setup-gradle#adding-job-summary-as-a-pull-request-comment
actions: read # Required for https://github.com/dorny/test-reporter
checks: write # Required for https://github.com/dorny/test-reporter
jobs:
Test:
BuildAndTest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
gradle-home-cache-cleanup: true
dependency-graph: generate-and-submit
add-job-summary-as-pr-comment: always
- name: Run tests
run: ./gradlew test
run: ./gradlew build test
- name: Test report
env:
NODE_OPTIONS: '--max-old-space-size=6144'
Expand All @@ -47,3 +54,11 @@ jobs:
reporter: java-junit
list-suites: 'failed'
list-tests: 'failed'
- name: Build collector RPM package builder
run: docker build -t collector-rpm xroad-catalog-collector/packages/xroad-catalog-collector/docker
- name: Run collector RPM package builder
run: docker run -v $PWD:/workspace collector-rpm
- name: Build lister RPM package builder
run: docker build -t lister-rpm xroad-catalog-lister/packages/xroad-catalog-lister/docker
- name: Run lister RPM package builder
run: docker run -v $PWD:/workspace lister-rpm
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ xroad-catalog-collector/packages/xroad-catalog-collector/redhat/SRPMS/
xroad-catalog-persistence/classes/
.gradle/
out/
.sdkmanrc
.settings/*
.project
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id "com.github.hierynomus.license" version "${hierynomusLicenseVersion}"
id "org.owasp.dependencycheck" version "${owaspVersion}"
id "org.sonarqube" version "${sonarQubeVersion}"
alias (libs.plugins.hierynomus.license)
alias (libs.plugins.sonarqube)
id 'idea'
id 'jacoco'
}
Expand Down
27 changes: 0 additions & 27 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
org.gradle.jvmargs=-Xmx2048M
springBootVersion=2.7.5
h2DatabaseVersion=2.1.214
postgreSqlVersion=42.5.1
guavaVersion=31.1-jre
lombokVersion=1.18.24
jacksonVersion=2.14.1
jakartaVersion=2.1.1
springDocVersion=1.6.13
commonsCsvVersion=1.9.0
wsdl4jVersion=1.6.3
commonsBeanUtilsVersion=1.9.4
jaxbVersion=4.0.0
javaxJaxbVersion=2.3.0
javaxAnnotationVersion=1.3.2
XjcVersion=2.1.7
httpClientVersion=4.5.13
jsonVersion=20220924
akkaVersion=2.6.21
logbackVersion=1.4.5
jaxWsVersion=4.0.0
cxfVersion=3.5.0
cxfCoreVersion=4.0.0
jakartaServletVersion=6.0.0
mockitoInlineVersion=4.6.1
hierynomusLicenseVersion=0.16.1
sonarQubeVersion=3.0
owaspVersion=3.0.2
64 changes: 64 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[versions]
akka = "2.6.21"
commonsBeanUtils = "1.9.4"
commonsCsv = "1.9.0"
cxf = "3.5.0"
cxfCore = "4.0.0"
guava = "31.1-jre"
h2Database = "2.1.214"
hierynomusLicense = "0.16.1"
httpClient = "4.5.13"
jackson = "2.14.1"
jakarta = "2.1.1"
javaxAnnotation = "1.3.2"
javaxJaxb = "2.3.0"
jaxb = "4.0.0"
json = "20220924"
lombok = "1.18.24"
mockitoInline = "4.6.1"
postgreSql = "42.5.1"
sonarqube = "5.0.0.4638"
springBoot = "2.7.5"
springDoc = "1.6.13"
wsdl4j = "1.6.3"
xjc = "2.1.7"

[libraries]
akka-actor = { module = "com.typesafe.akka:akka-actor_3", version.ref = "akka" }
akka-slf4j = { module = "com.typesafe.akka:akka-slf4j_3", version.ref = "akka" }
akka-testkit = { module = "com.typesafe.akka:akka-testkit_3", version.ref = "akka" }
commons-bean-utils = { module = "commons-beanutils:commons-beanutils", version.ref = "commonsBeanUtils" }
commons-csv = { module = "org.apache.commons:commons-csv", version.ref = "commonsCsv" }
cxf-transport = { module = "org.apache.cxf:cxf-rt-transports-http", version.ref = "cxf" }
cxf-core = { module = "org.apache.cxf:cxf-core", version.ref = "cxfCore" }
cxf-jaxws = { module = "org.apache.cxf:cxf-rt-frontend-jaxws", version.ref = "cxfCore" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
h2-database = { module = "com.h2database:h2", version.ref = "h2Database" }
http-client = { module = "org.apache.httpcomponents:httpclient", version.ref = "httpClient" }
jackson = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jakarta = { module = "javax.ws.rs:javax.ws.rs-api", version.ref = "jakarta" }
javax-annotation = { module = "javax.annotation:javax.annotation-api", version.ref = "javaxAnnotation" }
javax-jaxb = { module = "javax.xml.bind:jaxb-api", version.ref = "javaxJaxb" }
jaxb-maven = { module = "com.sun.xml.ws:jaxws-maven-plugin", version.ref = "jaxb" }
jaxb-rt = { module = "com.sun.xml.ws:jaxws-rt", version.ref = "jaxb" }
jaxb-tools = { module = "com.sun.xml.ws:jaxws-tools", version.ref = "jaxb" }
jaxb-ws-api = { module = "jakarta.xml.ws:jakarta.xml.ws-api", version.ref = "jaxb" }
json = { module = "org.json:json", version.ref = "json" }
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "mockitoInline" }
postgresql = { module = "org.postgresql:postgresql", version.ref = "postgreSql" }
spring-boot-jpa = { module = "org.springframework.boot:spring-boot-starter-data-jpa", version.ref = "springBoot" }
spring-boot-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "springBoot" }
spring-boot-ws = { module = "org.springframework.boot:spring-boot-starter-web-services", version.ref = "springBoot" }
spring-doc = { module = "org.springdoc:springdoc-openapi-ui", version.ref = "springDoc" }
wsdl4j = { module = "wsdl4j:wsdl4j", version.ref = "wsdl4j" }
xjc = { module = "com.sun.xml.bind:jaxb-xjc", version.ref = "xjc" }

[bundles]
akka = [ "akka-actor", "akka-slf4j" ] # Don't include akka-testkit in this since it is not used in implementation
jaxb = [ "jaxb-rt", "jaxb-tools", "jaxb-ws-api" ] # Don't include jaxb-maven in this since it is not used in implementation

[plugins]
hierynomus-license = { id = "com.github.hierynomus.license", version.ref = "hierynomusLicense" }
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
spring-boot = { id = "org.springframework.boot", version.ref = "springBoot" }
5 changes: 5 additions & 0 deletions xroad-catalog-collector/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
*.class
target/
.gradle
.settings/*
bin/*
.project
.classpath
.factorypath
52 changes: 25 additions & 27 deletions xroad-catalog-collector/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.springframework.boot" version "${springBootVersion}"
alias (libs.plugins.spring.boot)
id 'java'
id 'eclipse'
id 'idea'
Expand Down Expand Up @@ -69,33 +69,31 @@ task wsImport {

dependencies {
implementation project(':xroad-catalog-persistence')
implementation ("javax.annotation:javax.annotation-api:${javaxAnnotationVersion}")
implementation ("javax.xml.bind:jaxb-api:${javaxJaxbVersion}")
implementation("com.google.guava:guava:${guavaVersion}")
implementation("org.apache.httpcomponents:httpclient:${httpClientVersion}")
implementation("org.json:json:${jsonVersion}")
implementation("org.springframework.boot:spring-boot-starter-web-services:${springBootVersion}")
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
implementation("com.typesafe.akka:akka-actor_3:${akkaVersion}")
implementation("com.typesafe.akka:akka-slf4j_3:${akkaVersion}")
implementation("org.apache.cxf:cxf-rt-frontend-jaxws:${cxfCoreVersion}")
implementation("org.apache.cxf:cxf-rt-transports-http:${cxfVersion}")
implementation("org.apache.cxf:cxf-core:${cxfCoreVersion}")
implementation("org.projectlombok:lombok:${lombokVersion}")
annotationProcessor("org.projectlombok:lombok:${lombokVersion}")
wsimport("com.sun.xml.ws:jaxws-maven-plugin:${jaxbVersion}")
implementation("jakarta.xml.ws:jakarta.xml.ws-api:${jaxbVersion}")
implementation("com.sun.xml.ws:jaxws-rt:${jaxbVersion}")
implementation("com.sun.xml.ws:jaxws-tools:${jaxbVersion}")
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}") {
exclude group: 'org.mockito', module :'mockito-core'
implementation (libs.javax.annotation)
implementation (libs.javax.jaxb)
implementation (libs.guava)
implementation (libs.http.client)
implementation (libs.json)
implementation (libs.spring.boot.ws)
implementation (libs.jackson)
implementation (libs.bundles.akka)
// Note that bundle seems to break something with CXF and being able top find api bindings, so using separate dependencies here
implementation (libs.cxf.jaxws)
implementation (libs.cxf.transport)
implementation (libs.cxf.core)
implementation (libs.lombok)
annotationProcessor (libs.lombok)
wsimport (libs.jaxb.maven)
implementation (libs.bundles.jaxb)
testImplementation (libs.spring.boot.test) {
exclude group: 'org.mockito', module :'mockito-core'
}
testImplementation("org.mockito:mockito-inline:${mockitoInlineVersion}")
testImplementation("com.typesafe.akka:akka-testkit_3:${akkaVersion}")
testImplementation("org.projectlombok:lombok:${lombokVersion}")
testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}")
testImplementation("javax.annotation:javax.annotation-api:${javaxAnnotationVersion}")
testImplementation("javax.xml.bind:jaxb-api:${javaxJaxbVersion}")
testImplementation (libs.mockito.inline)
testImplementation (libs.akka.testkit)
testImplementation (libs.lombok)
testAnnotationProcessor (libs.lombok)
testImplementation (libs.javax.annotation)
testImplementation (libs.javax.jaxb)
}

compileJava.dependsOn wsImport
Expand Down
5 changes: 5 additions & 0 deletions xroad-catalog-lister/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
xroad-catalog-lister.iml
.gradle/
.settings/*
bin/*
.project
.classpath
.factorypath
34 changes: 17 additions & 17 deletions xroad-catalog-lister/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.springframework.boot" version "${springBootVersion}"
alias (libs.plugins.spring.boot)
id 'java'
id 'eclipse'
id 'idea'
Expand Down Expand Up @@ -71,23 +71,23 @@ jar {

dependencies {
implementation project(':xroad-catalog-persistence')

implementation("javax.ws.rs:javax.ws.rs-api:${jakartaVersion}")
implementation("org.springdoc:springdoc-openapi-ui:${springDocVersion}")
implementation ("org.apache.commons:commons-csv:${commonsCsvVersion}")
implementation("org.springframework.boot:spring-boot-starter-web-services:${springBootVersion}")
implementation("org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}")
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
implementation("wsdl4j:wsdl4j:${wsdl4jVersion}")
implementation(files(genJaxb.classesDir).builtBy(genJaxb))
implementation("commons-beanutils:commons-beanutils:${commonsBeanUtilsVersion}")
implementation("com.google.guava:guava:${guavaVersion}")
jaxb("com.sun.xml.bind:jaxb-xjc:${XjcVersion}")
implementation("org.projectlombok:lombok:${lombokVersion}")
annotationProcessor("org.projectlombok:lombok:${lombokVersion}")
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
testImplementation("org.projectlombok:lombok:${lombokVersion}")
testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}")

implementation (libs.jakarta)
implementation (libs.spring.doc)
implementation (libs.commons.csv)
implementation (libs.spring.boot.ws)
implementation (libs.spring.boot.jpa)
implementation (libs.jackson)
implementation (libs.wsdl4j)
implementation (libs.commons.bean.utils)
implementation (libs.guava)
jaxb (libs.xjc)
implementation (libs.lombok)
annotationProcessor (libs.lombok)
testImplementation (libs.spring.boot.test)
testImplementation (libs.lombok)
testAnnotationProcessor (libs.lombok)
}

test {
Expand Down
7 changes: 6 additions & 1 deletion xroad-catalog-persistence/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
settings.gradle
xroad-catalog-persistence.ipr
xroad-catalog-persistence.iws
xroad-catalog-persistence.iml
xroad-catalog-persistence.iml
.settings/*
bin/*
.project
.classpath
.factorypath
21 changes: 11 additions & 10 deletions xroad-catalog-persistence/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.springframework.boot" version "${springBootVersion}"
alias (libs.plugins.spring.boot)
id 'java'
id 'eclipse'
id 'idea'
Expand All @@ -15,15 +15,16 @@ repositories {
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}")
implementation("com.h2database:h2:${h2DatabaseVersion}")
implementation("org.postgresql:postgresql:${postgreSqlVersion}")
implementation("com.google.guava:guava:${guavaVersion}")
implementation("org.projectlombok:lombok:${lombokVersion}")
annotationProcessor("org.projectlombok:lombok:${lombokVersion}")
testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
testImplementation("org.projectlombok:lombok:${lombokVersion}")
testAnnotationProcessor("org.projectlombok:lombok:${lombokVersion}")
implementation (libs.spring.boot.jpa)
implementation (libs.h2.database)
implementation (libs.postgresql)
implementation (libs.guava)
implementation (libs.lombok)
implementation (libs.lombok)
annotationProcessor (libs.lombok)
testImplementation (libs.spring.boot.test)
testImplementation (libs.lombok)
testAnnotationProcessor (libs.lombok)
}


Expand Down

0 comments on commit 147cb61

Please sign in to comment.