diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index 919ec49..c561ae2 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -39,3 +39,11 @@ jobs: - name: Build with Maven run: mvn clean install -U -B + - name: Generate coverage report + run: mvn test jacoco:report + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files : target/site/jacoco/jacoco.xml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..9571a5f --- /dev/null +++ b/codecov.yml @@ -0,0 +1,16 @@ + +codecov: + require_ci_to_pass: yes + notify: + wait_for_ci: yes +coverage: + status: + project: + default: + enabled: yes + threshold: null + target: auto + patch: + default: + target: 80% + threshold: 40% diff --git a/io.asgardeo.tomcat.oidc.agent/pom.xml b/io.asgardeo.tomcat.oidc.agent/pom.xml index da8da91..46c15d5 100644 --- a/io.asgardeo.tomcat.oidc.agent/pom.xml +++ b/io.asgardeo.tomcat.oidc.agent/pom.xml @@ -40,6 +40,11 @@ xerces xercesImpl + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -59,6 +64,25 @@ org.apache.maven.plugins maven-compiler-plugin + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/io.asgardeo.tomcat.oidc.sample/pom.xml b/io.asgardeo.tomcat.oidc.sample/pom.xml index 3fac5a0..1888309 100644 --- a/io.asgardeo.tomcat.oidc.sample/pom.xml +++ b/io.asgardeo.tomcat.oidc.sample/pom.xml @@ -39,6 +39,11 @@ io.asgardeo.tomcat.oidc.agent io.asgardeo.tomcat.oidc.agent + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -80,6 +85,25 @@ maven-clean-plugin 2.1 + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + diff --git a/pom.xml b/pom.xml index 359cc6c..a48e47e 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,11 @@ xercesImpl ${xerces.version} + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + @@ -87,6 +92,25 @@ false + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + @@ -124,5 +148,7 @@ 0.1.24 1.4 2.11.0 + + 0.8.6