From 732195f818d240666cf8b68a160b728fc4bd3129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sat, 4 Jan 2025 12:17:58 +0100 Subject: [PATCH 1/5] improve: add sonat to build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .github/workflows/sonar.yml | 44 +++++++++++++++++++++++++++++++++++++ pom.xml | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..9ae7160 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,44 @@ +name: Sonar + +env: + MAVEN_ARGS: -V -ntp -e + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true +on: + push: + paths-ignore: + - 'docs/**' + - 'adr/**' + branches: [ main ] + pull_request: + paths-ignore: + - 'docs/**' + - 'adr/**' + types: [ opened, synchronize, reopened ] + +jobs: + test: + runs-on: ubuntu-latest + if: ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'kubernetes-glue-operator' ) }} + steps: + - uses: actions/checkout@v4 + - name: Set up Java and Maven + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: 'maven' + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - 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 org.jacoco:jacoco-maven-plugin:prepare-agent clean install verify org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=java-operator-sdk_kubernetes-glue-operator + diff --git a/pom.xml b/pom.xml index a3b5569..363c810 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,8 @@ ${java.version} UTF-8 3.5.2 + java-operator-sdk + https://sonarcloud.io 6.13.1 3.8.3 24.1.1 From d36fa74bff5364b37efdf907a21460800d879b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sat, 4 Jan 2025 12:18:53 +0100 Subject: [PATCH 2/5] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 9ae7160..b7612f1 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -21,7 +21,7 @@ on: jobs: test: runs-on: ubuntu-latest - if: ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'kubernetes-glue-operator' ) }} + if: ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' ) }} steps: - uses: actions/checkout@v4 - name: Set up Java and Maven From 8c2a9b41201937e2ab6b6d0772ad22ba8b867c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sat, 4 Jan 2025 12:22:17 +0100 Subject: [PATCH 3/5] java version fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index b7612f1..455cf02 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 21 cache: 'maven' - name: Cache SonarCloud packages uses: actions/cache@v4 From 5e0de4e036358b9315fc21a3400a03462d376407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sat, 4 Jan 2025 12:36:15 +0100 Subject: [PATCH 4/5] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- src/test/java/io/javaoperatorsdk/operator/glue/TestUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/io/javaoperatorsdk/operator/glue/TestUtils.java b/src/test/java/io/javaoperatorsdk/operator/glue/TestUtils.java index e43d958..ea6bf0e 100644 --- a/src/test/java/io/javaoperatorsdk/operator/glue/TestUtils.java +++ b/src/test/java/io/javaoperatorsdk/operator/glue/TestUtils.java @@ -24,7 +24,7 @@ public class TestUtils { - public static final Duration GC_WAIT_TIMEOUT = Duration.ofSeconds(120); + public static final Duration GC_WAIT_TIMEOUT = Duration.ofSeconds(180); public static final Duration INITIAL_RECONCILE_WAIT_TIMEOUT = Duration.ofMillis(150); public static final int CRD_READY_WAIT = 1000; From eb9be3a338e0b8139337ac47247425f0d575249c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sat, 4 Jan 2025 13:22:07 +0100 Subject: [PATCH 5/5] job name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 455cf02..82cec91 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -19,7 +19,7 @@ on: types: [ opened, synchronize, reopened ] jobs: - test: + sonar: runs-on: ubuntu-latest if: ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' ) }} steps: