From 4248cf30385dbf1b1ed6f52b047e5a4179b86c8e Mon Sep 17 00:00:00 2001 From: Matthias Moninger <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:17:33 +0300 Subject: [PATCH] Add test summary to each job (#19824) --- .github/workflows/ci.yml | 16 ++++++++++++++++ scripts/run-tests | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 148ec7b5f4..2f5f69255d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,11 @@ jobs: - name: Run Tests if: matrix.platform != 'arm64' run: . scripts/setenv -q && run-tests + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "artifacts/test-**.xml" + if: matrix.platform != 'arm64' - name: Upload artifacts (openrct2.org) run: | . scripts/setenv @@ -185,6 +190,11 @@ jobs: - name: Run Tests if: ${{matrix.run_tests}} run: . scripts/setenv -q && run-tests + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "artifacts/test-**.xml" + if: ${{matrix.run_tests}} - name: Build artifacts run: | . scripts/setenv @@ -299,6 +309,7 @@ jobs: if-no-files-found: error - name: Run Tests run: . scripts/setenv -q && run-tests + - name: Upload artifacts (openrct2.org) run: | # Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116 @@ -400,6 +411,11 @@ jobs: run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fprofile-instr-generate -fcoverage-mapping" -DWITH_TESTS=on - name: Run Tests run: . scripts/setenv -q && LLVM_PROFILE_FILE="openrct2-coverage-%p.profraw" run-tests + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "artifacts/test-**.xml" + if: always() - name: Process coverage information run: | cd bin diff --git a/scripts/run-tests b/scripts/run-tests index ec0bd8adbc..11e4f0679a 100755 --- a/scripts/run-tests +++ b/scripts/run-tests @@ -20,5 +20,5 @@ if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then ./tests --gtest_output=xml:../artifacts/test-results.xml "$@" else echo -e "\033[0;36mRunning OpenRCT2 tests...\033[0m" - ctest --output-on-failure "$@" + ctest --output-on-failure --output-junit ../artifacts/test-results.xml "$@" fi