Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 53 additions & 94 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
target: auto
threshold: 0%
patch:
default:
target: auto
comment:
layout: "reach,diff,flags"
58 changes: 58 additions & 0 deletions jacoco-coverage-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@
<license.header.file>${project.parent.basedir}/LICENSE_HEADER.txt</license.header.file>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>io.tarantool</groupId>
Expand All @@ -41,9 +59,49 @@
<groupId>io.tarantool</groupId>
<artifactId>tarantool-schema</artifactId>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-core</artifactId>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-27</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-31</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-32</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-33</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-34</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-35</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-40</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Loading