Skip to content

Commit

Permalink
Maintenance (#22)
Browse files Browse the repository at this point in the history
- Sets up Gradle version catalog
- Updates many dependency versions
- Updates Gradle wrapper
- Updates workflow action versions
- Prepares Renovate integration

{patch}
  • Loading branch information
nagyesta authored Feb 19, 2022
1 parent 80ae213 commit 8b230f0
Show file tree
Hide file tree
Showing 20 changed files with 370 additions and 249 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ on:
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/assets/**'
- '.github/workflows/**'
- 'renovate.json'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
Expand All @@ -36,6 +38,16 @@ on:
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/assets/**'
- '.github/workflows/**'
- 'renovate.json'

permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

jobs:
analyze:
Expand All @@ -48,15 +60,16 @@ jobs:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #2.4.0
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b #1.0.4
- name: Set up JDK 8
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf #2.5.0
with:
distribution: adopt
java-version: 8
- name: Initialize CodeQL
uses: github/codeql-action/init@46110c361b7e9ea1b6f9c6ba2cc941fa7a106cca
uses: github/codeql-action/init@d39d5d5c9707b926d517b1b292905ef4c03aa777 #v1.1.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -66,6 +79,6 @@ jobs:
- name: Build with Gradle
run: ./gradlew build -x test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@46110c361b7e9ea1b6f9c6ba2cc941fa7a106cca
uses: github/codeql-action/analyze@d39d5d5c9707b926d517b1b292905ef4c03aa777 #v1.1.2
- name: Check dependencies with Gradle
run: ./gradlew ossIndexAudit -PossIndexUsername=${{ secrets.OSS_INDEX_USER }} -PossIndexPassword=${{ secrets.OSS_INDEX_PASSWORD }}
11 changes: 8 additions & 3 deletions .github/workflows/gradle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/assets/**'
- '.github/workflows/**'
- 'renovate.json'

permissions: read-all

jobs:
build:
Expand All @@ -25,14 +29,15 @@ jobs:

steps:
# Set up build environment
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #2.4.0
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf #2.5.0
with:
distribution: adopt
java-version: 8
- uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16 # save wrapper
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #2.1.7 save wrapper
with:
path: |
~/.gradle/wrapper
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/gradle-oss-index-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ on:
# * is a special character in YAML, so we have to quote this string
- cron: '0 7 * * 1,3,5'

permissions: read-all

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #2.4.0
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b #1.0.4
- name: Set up JDK 8
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf #2.5.0
with:
distribution: adopt
java-version: 8
- name: Check dependencies with Gradle
run: ./gradlew ossIndexAudit -PossIndexUsername=${{ secrets.OSS_INDEX_USER }} -PossIndexPassword=${{ secrets.OSS_INDEX_PASSWORD }}
11 changes: 8 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/assets/**'
- '.github/workflows/**'
- 'renovate.json'

permissions: read-all

jobs:
build:
Expand All @@ -24,14 +28,15 @@ jobs:

steps:
# Set up build environment
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #2.4.0
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2
uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf #2.5.0
with:
distribution: adopt
java-version: 8
- uses: actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16 # save wrapper
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed #2.1.7 save wrapper
with:
path: |
~/.gradle/wrapper
Expand Down
18 changes: 9 additions & 9 deletions boosters/booster-cucumber-jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ project.ext {

dependencies {
implementation project(":mission-control")
implementation "org.slf4j:slf4j-api:${rootProject.ext.slf4jApiVersion}"
implementation "io.cucumber:cucumber-java:${rootProject.ext.cucumberVersion}"
implementation "io.cucumber:cucumber-junit:${rootProject.ext.cucumberVersion}"
implementation libs.slf4j.api
implementation libs.cucumber.java
implementation libs.cucumber.junit
testImplementation project(":boosters:testkit")
testImplementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.testSpringBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${rootProject.ext.testSpringBootVersion}"
testImplementation "io.cucumber:cucumber-spring:${rootProject.ext.cucumberVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${rootProject.ext.jupiterVersion}"
testImplementation "org.junit.vintage:junit-vintage-engine:${rootProject.ext.jupiterVersion}"
testImplementation "org.junit.platform:junit-platform-testkit:${rootProject.ext.jupiterTestKitVersion}"
testImplementation libs.spring.boot.starter
testImplementation libs.spring.boot.starter.test
testImplementation libs.cucumber.spring
testImplementation libs.jupiter.core
testImplementation libs.jupiter.vintage.engine
testImplementation libs.jupiter.platform.testkit
}

test {
Expand Down
14 changes: 7 additions & 7 deletions boosters/booster-junit-jupiter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ project.ext {

dependencies {
implementation project(":mission-control")
implementation "org.slf4j:slf4j-api:${rootProject.ext.slf4jApiVersion}"
implementation "org.junit.jupiter:junit-jupiter-api:${rootProject.ext.jupiterVersion}"
implementation "org.junit.jupiter:junit-jupiter:${rootProject.ext.jupiterVersion}"
implementation "org.junit.platform:junit-platform-reporting:${rootProject.ext.jupiterReportingVersion}"
implementation libs.slf4j.api
implementation libs.jupiter.api
implementation libs.jupiter.core
implementation libs.jupiter.platform.reporting
testImplementation project(":boosters:testkit")
testImplementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.testSpringBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${rootProject.ext.testSpringBootVersion}"
testImplementation "org.junit.platform:junit-platform-testkit:${rootProject.ext.jupiterTestKitVersion}"
testImplementation libs.spring.boot.starter
testImplementation libs.spring.boot.starter.test
testImplementation libs.jupiter.platform.testkit
}

test {
Expand Down
12 changes: 6 additions & 6 deletions boosters/booster-junit4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ project.ext {

dependencies {
implementation project(":mission-control")
implementation "junit:junit:${rootProject.ext.junit4Version}"
implementation libs.junit
testImplementation project(":boosters:testkit")
testImplementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.testSpringBootVersion}"
testImplementation "org.springframework.boot:spring-boot-starter-test:${rootProject.ext.testSpringBootVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${rootProject.ext.jupiterVersion}"
testImplementation "org.junit.vintage:junit-vintage-engine:${rootProject.ext.jupiterVersion}"
testImplementation "org.junit.platform:junit-platform-testkit:${rootProject.ext.jupiterTestKitVersion}"
testImplementation libs.spring.boot.starter
testImplementation libs.spring.boot.starter.test
testImplementation libs.jupiter.core
testImplementation libs.jupiter.vintage.engine
testImplementation libs.jupiter.platform.testkit
}

test {
Expand Down
10 changes: 5 additions & 5 deletions boosters/booster-testng/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ project.ext {

dependencies {
implementation project(":mission-control")
implementation "org.slf4j:slf4j-api:${rootProject.ext.slf4jApiVersion}"
implementation "org.testng:testng:${rootProject.ext.testNgVersion}"
implementation libs.slf4j.api
implementation libs.testng
testImplementation project(":boosters:testkit")
testImplementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.testSpringBootVersion}"
testImplementation("org.springframework.boot:spring-boot-starter-test:${rootProject.ext.testSpringBootVersion}") {
testImplementation libs.spring.boot.starter
testImplementation(libs.spring.boot.starter.test) {
exclude group: "org.junit.jupiter"
exclude group: "org.junit.vintage"
}
testImplementation "org.testng:testng:${rootProject.ext.latestTestNgVersion}"
implementation libs.testng
}

test {
Expand Down
11 changes: 5 additions & 6 deletions boosters/testkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ project.ext {

dependencies {
implementation project(":mission-control")
implementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.testSpringBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-test:${rootProject.ext.testSpringBootVersion}"
implementation "ch.qos.logback:logback-core:${rootProject.ext.logbackVersion}"
implementation "ch.qos.logback:logback-classic:${rootProject.ext.logbackVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${rootProject.ext.jupiterPlatformVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${rootProject.ext.jupiterPlatformVersion}"
implementation libs.spring.boot.starter
implementation libs.spring.boot.starter.test
implementation libs.bundles.logback
testImplementation libs.jupiter.api
testImplementation libs.jupiter.core
}

test {
Expand Down
34 changes: 5 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'io.toolebox.git-versioner' version '1.6.5'
id 'org.sonatype.gradle.plugins.scan' version '2.2.2' apply false
id 'org.owasp.dependencycheck' version '6.5.2' apply false
alias(libs.plugins.versioner)
alias(libs.plugins.index.scan)
alias(libs.plugins.owasp.dependencycheck)
}

group = 'com.github.nagyesta.abort-mission'
Expand All @@ -21,30 +21,6 @@ project.ext {
maintainerUrl = 'https://github.com/nagyesta/'
scmConnection = 'scm:git:https://github.com/nagyesta/abort-mission.git'
scmProjectUrl = 'https://github.com/nagyesta/abort-mission/'

// dependency versions
// minimum supported dependency version
junit4Version = '4.13.2'
jupiterVersion = '5.8.2'
jupiterReportingVersion = '1.8.2'
testNgVersion = '7.4.0'
testSpringBootVersion = '2.6.2'

// internal build versions
jupiterTestKitVersion = '1.8.2'
jupiterPlatformVersion = '5.8.2'
latestTestNgVersion = '7.4.0'
mockitoCoreVersion = '4.1.0'
springBootVersion = '2.6.2'
springVersion = '5.3.14'
jdbiVersion = '3.18.0'
h2Version = '2.0.206'
gsonVersion = '2.8.9'
cucumberVersion = '7.1.0'
slf4jApiVersion = '1.7.32'
logbackVersion = '1.2.10'
jsonSchemaValidatorVersion = '1.0.64'
lombokVersion = '1.18.20'
}

versioner {
Expand Down Expand Up @@ -113,7 +89,7 @@ configure(subprojects.findAll({
jacocoTestReport.finalizedBy jacocoTestCoverageVerification

jacoco {
toolVersion = "0.8.2"
toolVersion = libs.versions.jacoco.get()
}

jacocoTestCoverageVerification {
Expand Down Expand Up @@ -177,7 +153,7 @@ configure(subprojects.findAll({
.fromFile(rootProject.file('config/checkstyle/checkstyle-stylesheet.xsl') as String)
}
}
checkstyle.toolVersion = '9.2.1'
checkstyle.toolVersion = libs.versions.checkstyle.get()

publishing {
repositories {
Expand Down
79 changes: 79 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[versions]
spring = "5.3.15"
springBoot = "2.6.3"
logback = "1.2.10"
jsonSchemaValidator = "1.0.64"
gson = "2.8.9"
slf4j = "1.7.32"
h2 = "2.1.210"
jdbi3 = "3.18.0"

lombok = "1.18.22"

junit4 = "4.13.2"
jupiter = "5.8.2"
jupiterPlatform = "1.8.2"
mockitoCore = "4.3.1"
cucumber = "7.2.3"
testNg = "7.5"

lombokPlugin = "6.4.1"
springBootPlugin = "2.6.3"
minifyPlugin = "1.3.0"
gitVersionerPlugin = "1.6.7"
indexScanPlugin = "2.2.3"
owaspPlugin = "6.5.3"

checkstyle = "9.2.1"
jacoco = "0.8.2"

[libraries]
spring-core = { module = "org.springframework:spring-core", version.ref = "spring" }
spring-context = { module = "org.springframework:spring-context", version.ref = "spring" }

spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springBoot" }
spring-boot-starter-json = { module = "org.springframework.boot:spring-boot-starter-json", version.ref = "springBoot" }
spring-boot-starter-thymeleaf = { module = "org.springframework.boot:spring-boot-starter-thymeleaf", version.ref = "springBoot" }
spring-boot-configuration-processor = { module = "org.springframework.boot:spring-boot-configuration-processor", version.ref = "springBoot" }
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "springBoot" }

logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
logback-core = { module = "ch.qos.logback:logback-core", version.ref = "logback" }

gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
json-schema-validator = { module = "com.networknt:json-schema-validator", version.ref = "jsonSchemaValidator" }

slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

h2 = { module = "com.h2database:h2", version.ref = "h2" }
jdbi3-sqlobject = { module = "org.jdbi:jdbi3-sqlobject", version.ref = "jdbi3" }

lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }

junit = { module = "junit:junit", version.ref = "junit4" }

jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiter" }
jupiter-core = { module = "org.junit.jupiter:junit-jupiter", version.ref = "jupiter" }
jupiter-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "jupiter" }
jupiter-platform-testkit = { module = "org.junit.platform:junit-platform-testkit", version.ref = "jupiterPlatform" }
jupiter-platform-reporting = { module = "org.junit.platform:junit-platform-reporting", version.ref = "jupiterPlatform" }

mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }

testng = { module = "org.testng:testng", version.ref = "testNg" }

cucumber-java = { module = "io.cucumber:cucumber-java", version.ref = "cucumber" }
cucumber-junit = { module = "io.cucumber:cucumber-junit", version.ref = "cucumber" }
cucumber-spring = { module = "io.cucumber:cucumber-spring", version.ref = "cucumber" }

[bundles]
spring-boot-repoort = ["spring-boot-starter", "spring-boot-starter-json", "spring-boot-starter-thymeleaf"]
logback = ["logback-classic", "logback-core"]

[plugins]
spring-boot = { id = "org.springframework.boot", version.ref = "springBootPlugin" }
lombok = { id = "io.freefair.lombok", version.ref = "lombokPlugin" }
minify = { id = "org.gradlewebtools.minify", version.ref = "minifyPlugin" }
versioner = { id = "io.toolebox.git-versioner", version.ref = "gitVersionerPlugin" }
index-scan = { id = "org.sonatype.gradle.plugins.scan", version.ref = "indexScanPlugin" }
owasp-dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "owaspPlugin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# suppress inspection "SpellCheckingInspection" for whole file
# suppress inspection "UnusedProperty" for whole file
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Loading

0 comments on commit 8b230f0

Please sign in to comment.