Skip to content

Commit ebd06d8

Browse files
Switch to GitHub Actions (#10)
1 parent 99a9f56 commit ebd06d8

File tree

10 files changed

+69
-35
lines changed

10 files changed

+69
-35
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build
2+
run-name: CI build
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- $default-branch
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
jdk-version: [17]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
# This is needed for Sonar to do analysis
24+
fetch-depth: 0
25+
26+
- name: Setup Java JDK
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: ${{ matrix.jdk-version }}
30+
distribution: 'temurin'
31+
32+
- name: Setup Gradle
33+
uses: gradle/gradle-build-action@v2
34+
35+
- name: Run Gradle
36+
env:
37+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38+
run: ./gradlew -Dorg.gradle.welcome=never build jacocoTestReport testCodeCoverageReport sonar

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Spring Annotated Web Data Binder
22

3-
[![Build Status](https://travis-ci.com/mattbertolini/spring-annotated-web-data-binder.svg?branch=main)](https://travis-ci.com/mattbertolini/spring-annotated-web-data-binder)
3+
[![build](https://github.com/mattbertolini/spring-annotated-web-data-binder/actions/workflows/build.yml/badge.svg)](https://github.com/mattbertolini/spring-annotated-web-data-binder/actions/workflows/build.yml)
44
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mattbertolini_spring-annotated-web-data-binder&metric=coverage)](https://sonarcloud.io/dashboard?id=mattbertolini_spring-annotated-web-data-binder)
55
[![Spring MVC Annotated Data Binder](https://img.shields.io/maven-central/v/com.mattbertolini/spring-webmvc-annotated-data-binder.svg?label=Spring%20MVC%20Annotated%20Data%20Binder)](https://search.maven.org/search?q=g:%22com.mattbertolini%22%20AND%20a:%22spring-webmvc-annotated-data-binder%22)
66
[![Spring WebFlux Annotated Data Binder](https://img.shields.io/maven-central/v/com.mattbertolini/spring-webflux-annotated-data-binder.svg?label=Spring%20WebFlux%20Annotated%20Data%20Binder)](https://search.maven.org/search?q=g:%22com.mattbertolini%22%20AND%20a:%22spring-webflux-annotated-data-binder%22)

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
`jvm-test-suite`
44
jacoco
55
`jacoco-report-aggregation`
6-
id("org.sonarqube") version "3.3"
6+
id("org.sonarqube") version "4.0.0.2929"
77
}
88

99
val springVersion = "5.3.13"
@@ -122,8 +122,10 @@ dependencies {
122122
jacocoAggregation(project(":webmvc-annotated-data-binder-spring-boot-starter"))
123123
}
124124

125-
sonarqube {
125+
sonar {
126126
properties {
127+
property("sonar.host.url", "https://sonarcloud.io")
128+
property("sonar.organization", "github-mattbertolini")
127129
property("sonar.projectKey", "mattbertolini_spring-annotated-web-data-binder")
128130
property("sonar.coverage.jacoco.xmlReportPaths", reportXmlFile)
129131
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ plugins {
22
`kotlin-dsl`
33
}
44

5-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
6-
kotlinOptions {
7-
jvmTarget = "1.8"
8-
}
9-
}
10-
115
repositories {
126
mavenCentral()
137
}

buildSrc/src/main/kotlin/com/mattbertolini/build/maven-central-publish.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ publishing {
3232
}
3333

3434
publications {
35-
create<MavenPublication>("mavenJava") {
35+
register<MavenPublication>("mavenJava") {
3636
groupId = project.group as String
3737
artifactId = project.name
3838
version = project.version as String

gradle/wrapper/gradle-wrapper.jar

1.75 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

0 commit comments

Comments
 (0)