Skip to content

Commit

Permalink
Configurando a pipeline #3
Browse files Browse the repository at this point in the history
  • Loading branch information
algarves committed Jul 23, 2021
1 parent 352b0cd commit 1614af3
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 89 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Test with Gradle
run: ./gradlew check
- name: Generate test report with Gradle
run: ./gradlew jacocoTestReport
- name: Upload a Build Artifact
uses: actions/[email protected]
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew --build-cache assemble

- name: Test with Gradle
run: ./gradlew check

- name: Generate test report with Gradle
run: ./gradlew jacocoTestReport -Dsonar.login=${{ secrets.SONAR_KEY }} -Dsonar.qualitygate.wait=true

- name: Upload a Build Artifact
run: ./gradlew publish
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

23 changes: 11 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'jacoco'
id 'org.sonarqube' version '3.2.0'
id 'com.adarshr.test-logger' version '3.0.0'
}

group 'com.ueby'
Expand Down Expand Up @@ -30,19 +32,19 @@ repositories {

dependencies {
// Apache Fluent
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.+'
implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.+'

// Jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.+'
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: '2.9.+'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.9.+'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.+'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.+'
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: '2.9.+'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.9.+'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.+'

compile group: 'org.jsoup', name: 'jsoup', version: '1.13.+'
implementation group: 'org.jsoup', name: 'jsoup', version: '1.13.+'

// Log4j
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.+'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.+'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.+'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.+'

// Lombok
compileOnly 'org.projectlombok:lombok:1.18.+'
Expand Down Expand Up @@ -94,7 +96,4 @@ jacocoTestReport {
}
}

wrapper {
gradleVersion = '6.3'
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip"
}
apply from: "$project.rootDir/sonar.gradle"
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vertical=LoteriaCrawlersServices
vertical=LoteriaCrawlersServices

sonarQubeProjectKey=algarves_loteria-crawlers
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,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
25 changes: 7 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand All @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -61,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
6 changes: 0 additions & 6 deletions sonar-project.properties

This file was deleted.

17 changes: 17 additions & 0 deletions sonar.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apply plugin: "org.sonarqube"

def coverageExclusions = [
"**/test/**"
]

sonarqube {
properties {
property "sonar.sources", "src/main/*.java"
property "sonar.coverage.exclusions", coverageExclusions.join(",")
property "sonar.tests", "src/test/*.java"
property "sonar.java.binaries", "$build/classes/java/main/**/*.class"
property "sonar.java.libraries", "**.jar"
property "sonar.projectName", rootProject.name
property "sonar.projectKey", sonarQubeProjectKey
}
}

0 comments on commit 1614af3

Please sign in to comment.