diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6fd220196e..d9dfc4575c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -102,7 +102,7 @@ jobs: - name: Execute unit-test and report coverage if: success() && matrix.type == 'unit-test' - run: ./tests/executeUnitTests.sh --report-coverage + run: ./tests/executeUnitTests.sh --report-coverage --report-xml - name: Execute integration-test if: success() && matrix.type == 'integration-test' @@ -135,6 +135,13 @@ jobs: name: linux_${{ matrix.type }}_${{ github.event.pull_request.head.sha }} path: deploy/linux_${{ matrix.type }}/*.7z + - name: Upload Google Tests Results + uses: actions/upload-artifact@v2 + if: matrix.type == 'unit-test' # run this step even if previous step failed + with: + name: Linux_tests_results + path: "tests/gtest/**/*_xml_report.xml" + - name: Upload coverage report uses: codecov/codecov-action@v1 if: success() && matrix.type == 'unit-test' diff --git a/tests/executeUnitTests.sh b/tests/executeUnitTests.sh index 1623bf9d19..705a2fc219 100755 --- a/tests/executeUnitTests.sh +++ b/tests/executeUnitTests.sh @@ -36,12 +36,16 @@ ROOTDIR=$(pwd) CI_RUN="${TRAVIS:-false}" report="" doclean="" +xml="" while [[ $# -gt 0 ]]; do key="$1" case $key in --report-coverage) report="yes" ;; + --report-xml) + xml="yes" + ;; --clean) doclean="yes" ;; @@ -72,5 +76,9 @@ make if [ $? -ne 0 ]; then cd ../..; exit 1; fi for T in lib sched; do - [ -d "${T}" ] && ./${T}/test_${T}; + XML_FLAGS="" + if [ "${xml}" = "yes" ]; then + XML_FLAGS="--gtest_output=xml:${T}_xml_report.xml" + fi + [ -d "${T}" ] && ./${T}/test_${T} ${XML_FLAGS}; done