diff --git a/.github/workflows/add_final_status.xsl b/.github/workflows/add_final_status.xsl new file mode 100644 index 00000000..c515dfed --- /dev/null +++ b/.github/workflows/add_final_status.xsl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + fail + skip + pass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 3857068d..e84a7c7c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -66,7 +66,17 @@ jobs: run: cd ${BUILD_DIR} && test/tests -r junit -o report.xml env: ASAN_OPTIONS: alloc_dealloc_mismatch=0 + - name: Add final_status property + if: success() || failure() + run: | + which xsltproc || (apt-get update && apt-get install -y xsltproc) + xml_file=".build/report.xml" + echo "Fixing $xml_file" + tmp_file="$(mktemp)" + xsltproc --output "$tmp_file" ".github/workflows/add_final_status.xsl" "$xml_file" + mv "$tmp_file" "$xml_file" - name: Upload test report to Datadog + if: success() || failure() run: | 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 datadog-ci junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp .build/report.xml @@ -155,10 +165,25 @@ jobs: run: | & 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }} .\build\test\tests.exe -r junit -o report.xml + - name: Add final_status property + if: success() || failure() + run: | + $xmlFile = "report.xml" + $xslFile = ".github/workflows/add_final_status.xsl" + $tmpFile = [System.IO.Path]::GetTempFileName() + + echo "Fixing $xmlFile" + + $transform = New-Object System.Xml.Xsl.XslCompiledTransform + $transform.Load($xslFile) + $transform.Transform($xmlFile, $tmpFile) + + Move-Item -Force $tmpFile $xmlFile - name: Upload test report to Datadog + if: success() || failure() run: | Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe" - ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml + ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml coverage: needs: build-linux-cmake