diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d90e1bdf..0e0a51a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,12 +56,12 @@ jobs: - name: Print system images run: docker images - #- name: Upload jacoco exec results - # uses: actions/upload-artifact@v2 - # with: - # name: tests-unit-jacoco - # path: "**/jacoco-unit.exec" - # retention-days: 1 + - name: Upload jacoco exec + uses: actions/upload-artifact@v4 + with: + name: jacoco-unit + path: "**/target/jacoco-unit.exec" + retention-days: 1 tests-box-integration: runs-on: ubuntu-22.04 @@ -107,17 +107,17 @@ jobs: TARANTOOL_VERSION: ${{ matrix.tarantool-version }} TARANTOOL_SERVER_USER: root TARANTOOL_SERVER_GROUP: root - run: ./mvnw -B test -P box-integration -Djacoco.destFile=target/jacoco-box-integration.exec --file pom.xml + run: ./mvnw -B test -P box-integration -Djacoco.destFile=target/jacoco-box-${{ matrix.tarantool-version }}.exec --file pom.xml - name: Print system images run: docker images - # - name: Upload jacoco exec results - # uses: actions/upload-artifact@v2 - # with: - # name: tests-box-integration-jacoco - # path: "**/jacoco-box-integration.exec" - # retention-days: 1 + - name: Upload jacoco exec + uses: actions/upload-artifact@v4 + with: + name: jacoco-box-${{ matrix.tarantool-version }} + path: "**/target/jacoco-box-${{ matrix.tarantool-version }}.exec" + retention-days: 1 tests-crud-integration: runs-on: ubuntu-22.04 @@ -163,88 +163,47 @@ jobs: TARANTOOL_VERSION: ${{ matrix.tarantool-version }} TARANTOOL_SERVER_USER: root TARANTOOL_SERVER_GROUP: root - run: ./mvnw -B test -P crud-integration -Djacoco.destFile=target/jacoco-cartridge-integration.exec --file pom.xml + run: ./mvnw -B test -P crud-integration -Djacoco.destFile=target/jacoco-crud-${{ matrix.tarantool-version }}.exec --file pom.xml - name: Print system images run: docker images - #- name: Upload jacoco exec results - # uses: actions/upload-artifact@v2 - # with: - # name: tests-cartridge-integration-jacoco - # path: "**/jacoco-cartridge-integration.exec" - # retention-days: 1 - - #merge-jacoco-report: - # name: Jacoco Merge Results - # needs: - # - tests-unit - # - tests-box-integration - # - tests-crud-integration - # - tests-ee - # - tests-dr - # runs-on: ubuntu-20.04-self-hosted - # steps: - # - uses: actions/checkout@v6 - - # - name: Set up JDK 17 - # uses: actions/setup-java@v5 - # with: - # distribution: 'temurin' - # java-version: '17' - # cache: 'maven' - - # - uses: actions/download-artifact@v2 - # with: - # name: tests-unit-jacoco - # path: target/ - - # - uses: actions/download-artifact@v2 - # with: - # name: tests-box-integration-jacoco - # path: target/ - - # - uses: actions/download-artifact@v2 - # with: - # name: tests-cartridge-integration-jacoco - # path: target/ - - # - uses: actions/download-artifact@v2 - # with: - # name: tests-ee-jacoco - # path: target/ - - # - uses: actions/download-artifact@v2 - # continue-on-error: true - # with: - # name: tests-dr-jacoco - # path: target/ - - # - name: merge results - # run: | - # cp -r ./target/tarantool-core/target ./tarantool-core/target && \ - # cp -r ./target/tarantool-jackson-mapping/target ./tarantool-jackson-mapping/target && \ - # cp -r ./target/tarantool-client/target ./tarantool-client/target && \ - # cp -r ./target/tarantool-pooling/target ./tarantool-pooling/target && \ - # cp -r ./target/tarantool-balancer/target ./tarantool-balancer/target && \ - # cp -r ./target/tarantool-schema/target ./tarantool-schema/target && \ - # ./mvnw -DskipTests -Darguments=-DskipTests package jacoco:report-aggregate && ls -la - - # - name: Upload jacoco coverage despite the check result - # if: ${{ always() }} - # uses: actions/upload-artifact@v2 - # with: - # name: coverage-results-report - # path: jacoco-coverage-aggregate-report/target/site/jacoco-aggregate - # if-no-files-found: error - # retention-days: 1 - - # - name: Jacoco Report to PR - # id: jacoco - # uses: madrapps/jacoco-report@v1.6.1 - # with: - # paths: jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml - # token: ${{ secrets.GITHUB_TOKEN }} - # min-coverage-overall: 40 - # min-coverage-changed-files: 60 - # update-comment: true + - name: Upload jacoco exec + uses: actions/upload-artifact@v4 + with: + name: jacoco-crud-${{ matrix.tarantool-version }} + path: "**/target/jacoco-crud-${{ matrix.tarantool-version }}.exec" + retention-days: 1 + + merge-jacoco-report: + name: Merge JaCoCo and upload coverage + needs: + - tests-unit + - tests-box-integration + - tests-crud-integration + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v6 + + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + + - name: Download jacoco exec files + uses: actions/download-artifact@v4 + with: + pattern: jacoco-* + path: . + merge-multiple: true + + - name: Build classes and aggregate JaCoCo report + run: ./mvnw -B -DskipTests -Darguments=-DskipTests -Dcheckstyle.skip -Ddependency-check.skip verify -pl jacoco-coverage-aggregate-report -am --file pom.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml + fail_ci_if_error: true diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..628717ad --- /dev/null +++ b/codecov.yml @@ -0,0 +1,11 @@ +coverage: + status: + project: + default: + target: auto + threshold: 0% + patch: + default: + target: auto +comment: + layout: "reach,diff,flags" diff --git a/jacoco-coverage-aggregate-report/pom.xml b/jacoco-coverage-aggregate-report/pom.xml index 59952030..06f35dc9 100644 --- a/jacoco-coverage-aggregate-report/pom.xml +++ b/jacoco-coverage-aggregate-report/pom.xml @@ -16,6 +16,24 @@ ${project.parent.basedir}/LICENSE_HEADER.txt + + + + org.jacoco + jacoco-maven-plugin + + + report-aggregate + verify + + report-aggregate + + + + + + + io.tarantool @@ -41,9 +59,49 @@ io.tarantool tarantool-schema + + io.tarantool + tarantool-spring-data-core + + + io.tarantool + tarantool-spring-data-27 + ${project.version} + + + io.tarantool + tarantool-spring-data-31 + ${project.version} + + + io.tarantool + tarantool-spring-data-32 + ${project.version} + + + io.tarantool + tarantool-spring-data-33 + ${project.version} + + + io.tarantool + tarantool-spring-data-34 + ${project.version} + + + io.tarantool + tarantool-spring-data-35 + ${project.version} + + + io.tarantool + tarantool-spring-data-40 + ${project.version} + io.tarantool testcontainers + compile