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..602e16ad 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 @@ -145,7 +155,7 @@ jobs: Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH - name: Install Dependencies - run: scoop install main/cmake@4.0.1 main/ninja + run: scoop install main/cmake@4.0.1 main/ninja main/libxslt - name: Build run: | & 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }} @@ -155,10 +165,18 @@ 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: | + $xml_file = "report.xml" + $tmp_file = [System.IO.Path]::GetTempFileName() + xsltproc --output $tmp_file ".github/workflows/add_final_status.xsl" $xml_file + Move-Item -Force $tmp_file $xml_file - 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