|
11 | 11 | required: true |
12 | 12 | DOCKER_PASSWORD: |
13 | 13 | required: true |
14 | | - CODECOV_TOKEN: |
15 | | - required: false |
16 | 14 | inputs: |
17 | 15 | # it is required for backwards compatibility with CI/CD pipelines that have not been yet fully migrated to shared workflows |
18 | 16 | uploadJarArtifact: |
|
40 | 38 | required: false |
41 | 39 | type: boolean |
42 | 40 | default: false |
43 | | - codeCoverageExcludes: |
44 | | - required: false |
45 | | - type: string |
46 | | - default: "" |
47 | 41 |
|
48 | 42 | env: |
49 | 43 | IMAGE_NAME_MIXED_CASE: "${{ github.repository }}" |
50 | 44 | TEST_STAGE: test |
51 | | - JACOCO_VERSION: "0.8.14" |
52 | | - JACOCO_REPORTS: "**/target/site/jacoco/jacoco.xml,**/target/site/jacoco-it/jacoco.xml,**/target/site/jacoco-aggregate/jacoco.xml" |
53 | 45 |
|
54 | 46 | jobs: |
55 | 47 | build-check-test-push: |
@@ -78,48 +70,33 @@ jobs: |
78 | 70 | working-directory: ${{ inputs.workingDirectory }} |
79 | 71 | env: |
80 | 72 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
81 | | - JACOCO_EXCLUDES: ${{ inputs.codeCoverageExcludes }} |
82 | 73 | JAVA_TOOL_OPTIONS: "" |
83 | 74 | MAVEN_OPTS: "" |
84 | | - run: | |
85 | | - JACOCO_EXCLUDES_ARG="" |
86 | | - if [[ -n "${JACOCO_EXCLUDES}" ]]; then |
87 | | - JACOCO_EXCLUDES_ARG="-Djacoco.excludes=${JACOCO_EXCLUDES}" |
88 | | - fi |
89 | | - |
90 | | - mvn -Djacoco.version=${JACOCO_VERSION} \ |
91 | | - "org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:prepare-agent" \ |
92 | | - test \ |
93 | | - "org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:report" \ |
94 | | - ${JACOCO_EXCLUDES_ARG} |
| 75 | + run: mvn -B test |
95 | 76 |
|
96 | 77 | - name: Run Integration tests (Testcontainers) |
97 | 78 | working-directory: ${{ inputs.workingDirectory }} |
98 | 79 | env: |
99 | 80 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
100 | | - JACOCO_EXCLUDES: ${{ inputs.codeCoverageExcludes }} |
101 | 81 | DOCKER_HOST: unix:///var/run/docker.sock |
102 | 82 | TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock |
103 | 83 | JAVA_TOOL_OPTIONS: "" |
104 | 84 | MAVEN_OPTS: "" |
105 | | - run: | |
106 | | - JACOCO_EXCLUDES_ARG="" |
107 | | - if [[ -n "${JACOCO_EXCLUDES}" ]]; then |
108 | | - JACOCO_EXCLUDES_ARG="-Djacoco.excludes=${JACOCO_EXCLUDES}" |
109 | | - fi |
110 | | - mvn "org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:prepare-agent-integration" \ |
111 | | - verify \ |
112 | | - "org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:report-integration" \ |
113 | | - ${JACOCO_EXCLUDES_ARG} |
| 85 | + run: mvn -B verify |
114 | 86 |
|
115 | 87 | - name: Upload coverage reports to Codecov |
116 | 88 | uses: codecov/codecov-action@v5 |
117 | 89 | with: |
118 | 90 | token: ${{ secrets.CODECOV_TOKEN }} |
119 | | - files: ${{ env.JACOCO_REPORTS }} |
120 | 91 | fail_ci_if_error: true |
121 | 92 | verbose: true |
122 | 93 |
|
| 94 | + - name: Upload test results to Codecov |
| 95 | + if: ${{ !cancelled() }} |
| 96 | + uses: codecov/test-results-action@v1 |
| 97 | + with: |
| 98 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 99 | + |
123 | 100 | - name: Build artifact |
124 | 101 | working-directory: ${{ inputs.workingDirectory }} |
125 | 102 | run: mvn package -Dmaven.test.skip |
@@ -201,7 +178,7 @@ jobs: |
201 | 178 | if: ${{ env.PERFORM_RELEASE == 'true' }} |
202 | 179 | uses: docker/setup-buildx-action@v3 |
203 | 180 |
|
204 | | - - name: Login to Github Container Registry |
| 181 | + - name: Login to Docker Hub |
205 | 182 | if: ${{ env.PERFORM_RELEASE == 'true' }} |
206 | 183 | uses: docker/login-action@v3 |
207 | 184 | with: |
|
0 commit comments