From d545a56ad814b6340d6e648c21415acc5c0bb356 Mon Sep 17 00:00:00 2001 From: clagosu Date: Tue, 19 Dec 2023 17:00:45 -0300 Subject: [PATCH 01/11] Create maven.yml --- .github/workflows/maven.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 000000000..a0121e8e0 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,33 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 From 66a54dbaf85d067e4431b378de634d50487005f9 Mon Sep 17 00:00:00 2001 From: clagosu Date: Tue, 19 Dec 2023 17:02:49 -0300 Subject: [PATCH 02/11] Update maven.yml --- .github/workflows/maven.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a0121e8e0..c7bce081f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,6 +28,4 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - - name: Update dependency graph - uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 + From ca2cb3862e04cb15af36b8b9cb53a9ac437c15d3 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 20:53:03 -0300 Subject: [PATCH 03/11] Update mvnw --- mvnw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mvnw b/mvnw index eb65ff257..0354b53b9 100644 --- a/mvnw +++ b/mvnw @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. # ---------------------------------------------------------------------------- - +# # ---------------------------------------------------------------------------- # Maven2 Start Up Batch script # From 91a24e7f4a17d62459a87fca3975828e2f036a42 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 20:54:53 -0300 Subject: [PATCH 04/11] Update maven.yml From cacfb67f99134496001e269fbec2f851a5855a62 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 20:57:11 -0300 Subject: [PATCH 05/11] Update build.gradle From 1c0cbc80e61f7c7d69908891191db2a6f345ef11 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:22:44 -0300 Subject: [PATCH 06/11] Update pom.xml --- pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a5c9e6e21..775e81ecc 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,9 @@ 1.8 - + cesarlorca + https://sonarcloud.io + From c6016ea6e4a5d675ea31647ecfac87d38386792e Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:24:22 -0300 Subject: [PATCH 07/11] Update pom.xml --- pom.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 775e81ecc..b4b7f3789 100644 --- a/pom.xml +++ b/pom.xml @@ -15,9 +15,7 @@ Demo project for Spring Boot - 1.8 - cesarlorca - https://sonarcloud.io + 1.8 From 8ac565f11d23a1555b6d0df0ad48b2a171fd39bc Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:26:19 -0300 Subject: [PATCH 08/11] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b4b7f3789..805d1323f 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 1.8 - + From f40ba74be1d0202373c70795ee0671c439a83943 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:34:00 -0300 Subject: [PATCH 09/11] Update pom.xml --- pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 805d1323f..98c75dfd3 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,9 @@ Demo project for Spring Boot - 1.8 + 1.8 + cesarlorca + https://sonarcloud.io From a28dd4880addb0b2c2649b9b912b32554bf78375 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:41:07 -0300 Subject: [PATCH 10/11] Create build.yml --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..fdb6a713b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: SonarCloud +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=cesarlorca_feature-ms-cesarlorca-mensaje From 188f94d1bbddbe95ac0d6ad5911e151cf1083b65 Mon Sep 17 00:00:00 2001 From: Cesar Antonio Lorca Bacian Date: Tue, 26 Dec 2023 21:46:22 -0300 Subject: [PATCH 11/11] Update build.gradle --- build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.gradle b/build.gradle index ee2bd23f9..c675b16c2 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,15 @@ plugins { id 'org.springframework.boot' version '2.6.3' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' + id "org.sonarqube" version "4.4.1.3373" +} + +sonar { + properties { + property "sonar.projectKey", "cesarlorca_feature-ms-cesarlorca-mensaje" + property "sonar.organization", "cesarlorca" + property "sonar.host.url", "https://sonarcloud.io" + } } group = 'com.example'