Skip to content

Commit b50cf01

Browse files
committed
enable SonarCloud, disable codecov.io
1 parent d762562 commit b50cf01

5 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- master
99
- experimental/**
1010
pull_request:
11+
types: [opened, synchronize, reopened]
1112
branches-ignore:
1213
- master
1314
- experimental/**
@@ -31,22 +32,35 @@ jobs:
3132
distribution: temurin
3233

3334
steps:
34-
# Check out Git repository
3535
- name: Checkout code
3636
uses: actions/checkout@v2
37+
with:
38+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
3739

38-
# Set up environment with Java and Maven
3940
- name: Setup JDK
4041
uses: actions/setup-java@v2
4142
with:
4243
distribution: ${{ matrix.distribution }}
4344
java-version: ${{ matrix.java }}
4445
cache: 'maven'
4546

46-
# Build & install (required for 2nd build: example)
47+
- name: Cache SonarCloud packages
48+
uses: actions/cache@v1
49+
with:
50+
path: ~/.sonar/cache
51+
key: ${{ runner.os }}-sonar
52+
restore-keys: ${{ runner.os }}-sonar
53+
4754
- name: Build and verify
4855
run: ./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean install
4956

50-
# Build & verify example
5157
- name: Build and verify example
5258
run: ./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean verify -f example
59+
60+
- name: Analyze in SonarCloud
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
63+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
# SONAR_TOKEN is not present when building for external PR
65+
run: ([ -z $SONAR_TOKEN ] || ./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B sonar:sonar -Dsonar.projectKey=${{github.repository_owner}}_${{github.event.repository.name}} -Dsonar.projectName=${{github.event.repository.name}})
66+
if: ${{ matrix.java == '11' && matrix.os == 'ubuntu-latest' }}

.github/workflows/maven-deploy.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,27 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
# Check out Git repository
1817
- name: Checkout code
1918
uses: actions/checkout@v2
2019

21-
# Configure GIT
2220
- name: Configure GIT
2321
run: |
2422
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
2523
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
2624
27-
# Set up environment with Java and Maven
2825
- name: Setup JDK
2926
uses: actions/setup-java@v2
3027
with:
3128
distribution: temurin
3229
java-version: 8
3330
cache: 'maven'
3431

35-
# Build, deploy to ossrh, generate and stage site
3632
- name: Build, verify, deploy, generate site
3733
env:
3834
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3935
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
4036
run: ./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean deploy site
4137

42-
# Run code coverage check
43-
- name: Run code coverage check
44-
run: bash <(curl -s https://codecov.io/bash)
45-
46-
# Deploy site to Github Pages
4738
- name: Stage and deploy site
4839
run: >
4940
./mvnw -s ./.maven-settings.xml -Pcontinuous-integration -B site:stage scm-publish:publish-scm

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<img src="https://wcm.io/images/favicon-16@2x.png"/> CONGA Plugin for AEM
22
======
33
[![Build](https://github.com/wcm-io-devops/conga-aem-plugin/workflows/Build/badge.svg?branch=develop)](https://github.com/wcm-io-devops/conga-aem-plugin/actions?query=workflow%3ABuild+branch%3Adevelop)
4-
[![Code Coverage](https://codecov.io/gh/wcm-io-devops/conga-aem-plugin/branch/develop/graph/badge.svg)](https://codecov.io/gh/wcm-io-devops/conga-aem-plugin)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm.devops.conga.plugins/io.wcm.devops.conga.plugins.aem/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm.devops.conga.plugins/io.wcm.devops.conga.plugins.aem)
5+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wcm-io-devops_conga-aem-plugin&metric=coverage)](https://sonarcloud.io/summary/new_code?id=wcm-io-devops_conga-aem-plugin)
56

67
Documentation: https://devops.wcm.io/conga/plugins/aem/<br/>
78
Issues: https://wcm-io.atlassian.net/projects/WDCONGA<br/>

parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>io.wcm.devops</groupId>
2727
<artifactId>io.wcm.devops.parent_toplevel</artifactId>
28-
<version>1.2.10</version>
28+
<version>1.3.0-SNAPSHOT</version>
2929
<relativePath />
3030
</parent>
3131

src/site/site.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<project name="CONGA AEM Plugin"
2323
xmlns="http://maven.apache.org/DECORATION/1.8.0"
2424
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25-
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd">
25+
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd">
2626

2727
<bannerRight>
2828
<name><![CDATA[<img src="https://devops.wcm.io/conga/images/conga.png" style="height:120px"/>]]></name>

0 commit comments

Comments
 (0)