|
66 | 66 | run: cd ${BUILD_DIR} && test/tests -r junit -o report.xml |
67 | 67 | env: |
68 | 68 | ASAN_OPTIONS: alloc_dealloc_mismatch=0 |
| 69 | + - name: Add final_status property |
| 70 | + if: success() || failure() |
| 71 | + run: | |
| 72 | + which xsltproc || (apt-get update && apt-get install -y xsltproc) |
| 73 | + xml_file=".build/report.xml" |
| 74 | + echo "Fixing $xml_file" |
| 75 | + tmp_file="$(mktemp)" |
| 76 | + xsltproc --output "$tmp_file" ".github/workflows/add_final_status.xsl" "$xml_file" |
| 77 | + mv "$tmp_file" "$xml_file" |
69 | 78 | - name: Upload test report to Datadog |
| 79 | + if: success() || failure() |
70 | 80 | run: | |
71 | 81 | curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-${{ matrix.arch }}" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci |
72 | 82 | datadog-ci junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp .build/report.xml |
@@ -155,10 +165,25 @@ jobs: |
155 | 165 | run: | |
156 | 166 | & 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }} |
157 | 167 | .\build\test\tests.exe -r junit -o report.xml |
| 168 | + - name: Add final_status property |
| 169 | + if: success() || failure() |
| 170 | + run: | |
| 171 | + $xmlFile = "report.xml" |
| 172 | + $xslFile = ".github/workflows/add_final_status.xsl" |
| 173 | + $tmpFile = [System.IO.Path]::GetTempFileName() |
| 174 | + |
| 175 | + echo "Fixing $xmlFile" |
| 176 | +
|
| 177 | + $transform = New-Object System.Xml.Xsl.XslCompiledTransform |
| 178 | + $transform.Load($xslFile) |
| 179 | + $transform.Transform($xmlFile, $tmpFile) |
| 180 | +
|
| 181 | + Move-Item -Force $tmpFile $xmlFile |
158 | 182 | - name: Upload test report to Datadog |
| 183 | + if: success() || failure() |
159 | 184 | run: | |
160 | 185 | Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe" |
161 | | - ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml |
| 186 | + ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml |
162 | 187 |
|
163 | 188 | coverage: |
164 | 189 | needs: build-linux-cmake |
|
0 commit comments