From 074e3c9d7d20a071a37b32e04c50bef34694d67f Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 26 Oct 2022 16:31:11 -0400 Subject: [PATCH 01/15] chore: Add maven sonar workflow --- .github/workflows/sonar.yaml | 30 ++++++++++++++++++++++++++++++ pom.xml | 2 ++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index bee732f23..e972f59c7 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -34,3 +34,33 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: ./gradlew build sonarqube --info + build-maven: + name: Java 11 Maven Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - 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 + id: mvn-cache + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven + - name: Maven Install + run: mvn clean install -DskipTests + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn sonar:sonar -Dsonar.projectKey=googleapis_gax-java diff --git a/pom.xml b/pom.xml index 9e57a3f8c..994c39c3d 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,8 @@ 1.8 1.8 1.10 + googleapis + https://sonarcloud.io From a690ec0de08c7ddb2c36b017acafa880e983d600 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 26 Oct 2022 16:33:29 -0400 Subject: [PATCH 02/15] chore: Use latest action versions --- .github/workflows/sonar.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e972f59c7..5bc316d7e 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -38,12 +38,13 @@ jobs: name: Java 11 Maven Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 11 - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: + distribution: temurin java-version: 11 - name: Cache SonarCloud packages uses: actions/cache@v3 From 06bcdacc5fbf0e2ba2d834f3370172e313b36e09 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 26 Oct 2022 17:07:45 -0400 Subject: [PATCH 03/15] chore: Rename gradle sonar job name --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 5bc316d7e..c4a1b180d 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -6,7 +6,7 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - build: + build-gradle: name: Java 11 Gradle Build runs-on: ubuntu-latest steps: From 4d3dbd7c7e231409e75c5f1b685403a37bacf2bd Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 26 Oct 2022 22:47:14 -0400 Subject: [PATCH 04/15] chore: Fix syntax error in sonar workflow --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index c4a1b180d..3ff2c27f5 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -42,7 +42,7 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 11 - - uses: actions/setup-java@v3 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 From 0fcb4d49da0ddea7bbab4e3f2f21aeb8e28629ce Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 17:44:22 -0500 Subject: [PATCH 05/15] chore: Use jacoco for coverage --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index 994c39c3d..f218a6e79 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,9 @@ 1.10 googleapis https://sonarcloud.io + jacoco + ${project.basedir}/../target/jacoco.exec + java From eb8192c5500d04450255cd11a0c8a19887459c72 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 17:45:50 -0500 Subject: [PATCH 06/15] chore: Temp disable gradle sonar --- .github/workflows/sonar.yaml | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 3ff2c27f5..a87fc2db1 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -6,35 +6,35 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - build-gradle: - name: Java 11 Gradle Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew build sonarqube --info - build-maven: +# sonar-gradle: +# name: Java 11 Gradle Build +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# with: +# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis +# - name: Set up JDK 11 +# uses: actions/setup-java@v1 +# with: +# java-version: 11 +# - name: Cache SonarCloud packages +# uses: actions/cache@v3 +# with: +# path: ~/.sonar/cache +# key: ${{ runner.os }}-sonar +# restore-keys: ${{ runner.os }}-sonar +# - name: Cache Gradle packages +# uses: actions/cache@v3 +# with: +# path: ~/.gradle/caches +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} +# restore-keys: ${{ runner.os }}-gradle +# - name: Build and analyze +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# run: ./gradlew build sonarqube --info + sonar-maven: name: Java 11 Maven Build runs-on: ubuntu-latest steps: From bf858a9015f212386ca5a14b30b7d089c467504e Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 17:53:32 -0500 Subject: [PATCH 07/15] chore: Ignore enforcer and clirr --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index a87fc2db1..7af41c2bf 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -64,4 +64,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn sonar:sonar -Dsonar.projectKey=googleapis_gax-java + run: mvn sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Denforcer.skip -Dclirr.skip From 2d37fab02e0ae6450da8b092cfa4f0024a2e69b9 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 17:56:34 -0500 Subject: [PATCH 08/15] chore: Ignore enforcer and clirr on install --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 7af41c2bf..e7cd0fc36 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -59,7 +59,7 @@ jobs: path: ~/.m2/repository key: ${{ runner.os }}-maven - name: Maven Install - run: mvn clean install -DskipTests + run: mvn clean install -DskipTests -Denforcer.skip -Dclirr.skip - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any From ca8a7bb3424f696f532bb3568742f4f07bd5df23 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 18:04:55 -0500 Subject: [PATCH 09/15] chore: Use correct path --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3c3558e42..f8d23e929 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ googleapis https://sonarcloud.io jacoco - ${project.basedir}/../target/jacoco.exec + ${project.basedir}/target/jacoco.exec java From 5bfb678a0f85a2afb542c42d3fd7d794ad01f8ac Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 18:10:55 -0500 Subject: [PATCH 10/15] chore: Use user property for sonar config --- .github/workflows/sonar.yaml | 9 ++++----- pom.xml | 5 ----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e7cd0fc36..e499aaed5 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -54,14 +54,13 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages uses: actions/cache@v3 - id: mvn-cache with: path: ~/.m2/repository - key: ${{ runner.os }}-maven - - name: Maven Install - run: mvn clean install -DskipTests -Denforcer.skip -Dclirr.skip + 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 sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Denforcer.skip -Dclirr.skip + run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io + diff --git a/pom.xml b/pom.xml index f8d23e929..ec08f04cc 100644 --- a/pom.xml +++ b/pom.xml @@ -42,11 +42,6 @@ 1.8 1.8 1.10 - googleapis - https://sonarcloud.io - jacoco - ${project.basedir}/target/jacoco.exec - java From 75cf4023ab01ed18a58f3ef46507ada09b68643e Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 18:13:27 -0500 Subject: [PATCH 11/15] chore: Add enforcer and clirr skip --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index e499aaed5..8ccba803c 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -62,5 +62,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io + run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io -Denforcer.skip -Dclirr.skip From 91c5435c927d1d90818d581ede092284db44b2bc Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 18:45:33 -0500 Subject: [PATCH 12/15] chore: Update sonar.yaml --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index ec08f04cc..946158b83 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ 1.8 1.8 1.10 + ${project.basedir}/target/site/jacoco-aggregate/jacoco.xml @@ -240,6 +241,19 @@ + + org.jacoco + jacoco-maven-plugin + + + report + + report-aggregate + + verify + + + \ No newline at end of file From 971b4d3760a369a75ed372ab0dedd3676c14b6d6 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 18:51:43 -0500 Subject: [PATCH 13/15] chore: Re-add gradle sonar --- .github/workflows/sonar.yaml | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 8ccba803c..6ff2de742 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -6,34 +6,34 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: -# sonar-gradle: -# name: Java 11 Gradle Build -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# with: -# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis -# - name: Set up JDK 11 -# uses: actions/setup-java@v1 -# with: -# java-version: 11 -# - name: Cache SonarCloud packages -# uses: actions/cache@v3 -# with: -# path: ~/.sonar/cache -# key: ${{ runner.os }}-sonar -# restore-keys: ${{ runner.os }}-sonar -# - name: Cache Gradle packages -# uses: actions/cache@v3 -# with: -# path: ~/.gradle/caches -# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} -# restore-keys: ${{ runner.os }}-gradle -# - name: Build and analyze -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# run: ./gradlew build sonarqube --info + sonar-gradle: + name: Java 11 Gradle Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew build sonarqube --info sonar-maven: name: Java 11 Maven Build runs-on: ubuntu-latest @@ -62,5 +62,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io -Denforcer.skip -Dclirr.skip + run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io -Denforcer.skip -Dclirr.skip -Dsonar.verbose=true From 23e0aa35f323531dd5eb2f5d50ddfc12e6d36f5a Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 21:04:25 -0500 Subject: [PATCH 14/15] chore: Remove gradle sonar --- .github/workflows/sonar.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index 6ff2de742..b5727f4f4 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -6,34 +6,6 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - sonar-gradle: - name: Java 11 Gradle Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew build sonarqube --info sonar-maven: name: Java 11 Maven Build runs-on: ubuntu-latest From 1de5b5005b0a62bcab9defc477b44af0f7c5d9af Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 14 Nov 2022 21:11:47 -0500 Subject: [PATCH 15/15] chore: remove jacoco report aggregate --- pom.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pom.xml b/pom.xml index 946158b83..ec08f04cc 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,6 @@ 1.8 1.8 1.10 - ${project.basedir}/target/site/jacoco-aggregate/jacoco.xml @@ -241,19 +240,6 @@ - - org.jacoco - jacoco-maven-plugin - - - report - - report-aggregate - - verify - - - \ No newline at end of file