Skip to content

improve: add sonat to build #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -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:
sonar:
runs-on: ubuntu-latest
if: ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' ) }}
steps:
- uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
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

2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
<sonar.organization>java-operator-sdk</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<fabric8-client.version>6.13.1</fabric8-client.version>
<quarkus.version>3.8.3</quarkus.version>
<graalvm.version>24.1.1</graalvm.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading