diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml deleted file mode 100644 index 993e09df7..000000000 --- a/.github/workflows/coveralls.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Coveralls - -on: [pull_request] - -jobs: - - coveralls: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'adopt' - - name: Build & Test - run: mvn clean test - - name: Build with Maven - run: mvn test jacoco:report - - name: Coveralls Coverage Report Submission - run: mvn coveralls:report --define repoToken=${{ secrets.COVERALL_REPO_TOKEN }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 000000000..e07764489 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,42 @@ +name: Sonarcloud CI + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + SonarCloud-Build: + name: SonarCloud Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'zulu' + - name: Cache SonarQube Cloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Generate coverage report + run: mvn test jacoco:report + + - name: Run SonarCloud Analysis + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn sonar:sonar -Dsonar.projectKey=Adyen_adyen-java-api-library \ No newline at end of file diff --git a/pom.xml b/pom.xml index a658dd46c..c121ba4d0 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,8 @@ UTF-8 UTF-8 1.6.14 + adyen + https://sonarcloud.io scm:git:git@github.com:Adyen/adyen-java-api-library.git @@ -78,11 +80,22 @@ 0.8.12 - default-prepare-agent + prepare-agent prepare-agent + + report + + report + + + + XML + + +