diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8ed79d7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CodeCov CI with Maven + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + run-unit-tests: + + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@main + with: + submodules: recursive + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Run Unit tests with Maven + run: mvn -B clean test jacoco:report --file pom.xml --no-transfer-progress + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./target/coverage-reports/ + fail_ci_if_error: true + files: report + flags: unittests + name: codecov-umbrella + path_to_write_report: ${basedir}/target/coverage-reports/codecov_report.txt + verbose: true diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/pom.xml b/pom.xml index 811414c..9c6cd08 100755 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,32 @@ + src/main/java + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + + org.apache.maven.plugins maven-compiler-plugin @@ -116,6 +141,18 @@ UTF-8 + + org.codehaus.mojo + cobertura-maven-plugin + 2.7 + + + html + xml + + + + com.diffplug.spotless spotless-maven-plugin @@ -136,8 +173,8 @@ *.xml .gitignore - - + + true 4