|
15 | 15 |
|
16 | 16 | test-and-build-linux: |
17 | 17 | needs: Get-CI-Image-Tag |
| 18 | + timeout-minutes: 25 |
18 | 19 | env: |
19 | 20 | TEST_FILTER: ${{ matrix.test_filter }} |
20 | 21 | strategy: |
@@ -51,24 +52,40 @@ jobs: |
51 | 52 | # This is a hack, but this step creates a link to the X: mounted drive, which makes the path |
52 | 53 | # short enough to work on Windows |
53 | 54 | - name: Build with Gradle |
| 55 | + timeout-minutes: 20 |
54 | 56 | run: | |
55 | 57 | chown -R 1000:1000 `pwd` |
56 | 58 | su `id -un 1000` -c "./gradlew build ${{ env.TEST_FILTER }}" |
| 59 | + - name: Generate Jacoco Test Report |
| 60 | + if: always() && matrix.java == 21 |
| 61 | + run: | |
| 62 | + su `id -un 1000` -c "./gradlew jacocoTestReport" |
| 63 | + - name: Upload coverage XML |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + if: always() && matrix.java == 21 |
| 66 | + with: |
| 67 | + name: coverage-xml-${{ matrix.java }}-${{ matrix.feature }} |
| 68 | + path: build/reports/jacoco/**/jacocoTestReport.xml |
| 69 | + if-no-files-found: warn |
| 70 | + overwrite: 'true' |
57 | 71 | - name: Upload failed logs |
58 | 72 | uses: actions/upload-artifact@v4 |
59 | 73 | if: ${{ failure() }} |
60 | 74 | with: |
61 | 75 | name: logs-${{ matrix.java }}-${{ matrix.feature }} |
62 | 76 | path: build/testclusters/integTest-*/logs/* |
63 | 77 | overwrite: 'true' |
| 78 | + - name: Upload test reports |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + if: ${{ failure() }} |
| 81 | + with: |
| 82 | + name: test-reports-linux-${{ matrix.java }}-${{ matrix.feature }} |
| 83 | + path: build/reports/ |
| 84 | + overwrite: 'true' |
64 | 85 | - name: Create Artifact Path |
65 | 86 | run: | |
66 | 87 | mkdir -p index-management-artifacts |
67 | 88 | cp ./build/distributions/*.zip index-management-artifacts |
68 | | - - name: Uploads coverage |
69 | | - uses: codecov/codecov-action@v5 |
70 | | - with: |
71 | | - token: ${{ secrets.CODECOV_TOKEN }} |
72 | 89 | # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact |
73 | 90 | - name: Upload Artifacts |
74 | 91 | # v4 requires node.js 20 which is not supported |
@@ -134,3 +151,41 @@ jobs: |
134 | 151 | name: index-management-plugin-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.feature }} |
135 | 152 | path: index-management-artifacts |
136 | 153 | overwrite: 'true' |
| 154 | + |
| 155 | + report-coverage: |
| 156 | + needs: ["test-and-build-linux"] |
| 157 | + if: always() |
| 158 | + runs-on: ubuntu-latest |
| 159 | + steps: |
| 160 | + - uses: actions/checkout@v4 |
| 161 | + - uses: actions/download-artifact@v4 |
| 162 | + with: |
| 163 | + path: downloaded-artifacts |
| 164 | + pattern: coverage-xml-* |
| 165 | + |
| 166 | + - name: Display structure of downloaded files |
| 167 | + run: ls -R |
| 168 | + working-directory: downloaded-artifacts |
| 169 | + |
| 170 | + - name: Check if coverage files exist |
| 171 | + id: check_coverage |
| 172 | + run: | |
| 173 | + if find downloaded-artifacts -name "*.xml" -type f | grep -q .; then |
| 174 | + echo "Coverage XML files found" |
| 175 | + echo "has_coverage=true" >> $GITHUB_OUTPUT |
| 176 | + else |
| 177 | + echo "No coverage XML files found" |
| 178 | + echo "has_coverage=false" >> $GITHUB_OUTPUT |
| 179 | + fi |
| 180 | +
|
| 181 | + - name: Upload Coverage with retry |
| 182 | + if: steps.check_coverage.outputs.has_coverage == 'true' |
| 183 | + |
| 184 | + with: |
| 185 | + attempt_limit: 5 |
| 186 | + attempt_delay: 2000 |
| 187 | + action: codecov/codecov-action@v4 |
| 188 | + with: | |
| 189 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 190 | + fail_ci_if_error: true |
| 191 | + verbose: true |
0 commit comments