Skip to content
Permalink
Browse files

move all CI logic to ctest2ci

  • Loading branch information
3nids authored and nyalldawson committed Feb 8, 2021
1 parent 4eed1d2 commit 7bc0f19f3190f9e729e8cd2a49a4ef3d5537f595
Showing with 11 additions and 16 deletions.
  1. +2 −11 .ci/config.ctest
  2. +4 −0 .ci/ctest2ci.py
  3. +5 −5 .github/workflows/run-tests.yml
@@ -64,11 +64,7 @@ IF(NOT IGNORE_BUILD_FAILURES)
IF(NOT ${BUILDRES} EQUAL 0 OR NOT ${NUMERR} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}")
# Github step output
MESSAGE("::set-output name=TESTS_PASS::false")
MESSAGE("::set-output name=CDASH_URL::${SHORTURL}")
MESSAGE(" ${Yellow}Test results submitted to:${ColorReset} ${SHORTURL}")
MESSAGE("")
MESSAGE( FATAL_ERROR " ${Red}Build failed. Not running tests.${ColorReset}" )
MESSAGE("")
@@ -78,11 +74,7 @@ ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL ${PARALLEL_LEVEL} R
IF(NOT ${NUMWARN} EQUAL 0 OR NOT ${TESTRES} EQUAL 0)
ctest_submit (RETRY_COUNT 3 RETRY_DELAY 30)
MESSAGE("")
MESSAGE(" ${Yellow}Test results submitted to${ColorReset}")
MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}" )
# Github step output
MESSAGE("::set-output name=TESTS_PASS::false")
MESSAGE("::set-output name=CDASH_URL::${SHORTURL}")
MESSAGE(" ${Yellow}Test results submitted to:${ColorReset} ${SHORTURL}" )
MESSAGE("")
SET(LEVEL "")
IF(NOT ${TESTRES} EQUAL 0)
@@ -103,6 +95,5 @@ IF(NOT ${TESTRES} EQUAL 0)
MESSAGE(" ${BoldGreen}Success${ColorReset}")
MESSAGE(" ${Green}All tests passed successfully.${ColorReset}")
MESSAGE("")
MESSAGE("::set-output name=TESTS_PASS::true")
MESSAGE("")
ENDIF(NOT ${TESTRES} EQUAL 0)
@@ -108,6 +108,8 @@ def start_test_fold():
in_failure = True

if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line):
tests_failing = re.match(r'([0-9]+) tests failed', updated_line).group(1)
updated_line += '\n::set-output name=TESTS_FAILING::{}'.format(tests_failing)
end_fold()

if re.search('100% tests passed', updated_line):
@@ -116,6 +118,8 @@ def start_test_fold():
if re.match('Submit files', updated_line):
start_fold('submit')
elif re.search('Test results submitted to', updated_line):
cdash_url = re.match(r'(http.*)$', updated_line).group(1)
updated_line += '\n::set-output name=CDASH_URL::{}'.format(cdash_url)
end_fold()

sys.stdout.write(updated_line)
@@ -35,9 +35,9 @@ jobs:
runs-on: ubuntu-latest

outputs:
cdash_url: ${{ steps.tests.outputs.CDASH_URL }}
compile_outcome: ${{ steps.compile.outcome }}
tests_pass: ${{ steps.tests.outputs.TESTS_PASS }}
tests_failing: ${{ steps.tests.outputs.TESTS_FAILING }}
cdash_url: ${{ steps.tests.outputs.CDASH_URL }}
runners_outcome: ${{ steps.runners.outcome }}

steps:
@@ -193,14 +193,14 @@ jobs:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CDASH_URL: ${{ needs.build.outputs.cdash_url }}
COMPILE_OUTCOME: ${{ needs.build.outputs.compile_outcome }}
TESTS_PASS: ${{ needs.build.outputs.tests_pass }}
TESTS_FAILING: ${{ needs.build.outputs.tests_failing }}
RUNNERS_OUTCOME: ${{ needs.build.outputs.runners_outcome }}
run: |
echo "::set-output name=COMMENT_ID::"$([[ "${COMMENT_FOUND}" -eq "0" ]] && echo ${COMMENT_CREATED} || echo ${COMMENT_FOUND})
if [[ ${COMPILE_OUTCOME} != "success" ]]; then
echo "::set-output name=COMMENT_BODY::${COMMIT_SHA} :scream: compilation failed"
elif [[ ${TESTS_PASS} != "true" ]]; then
echo "::set-output name=COMMENT_BODY::${COMMIT_SHA} :fire: some unit-tests are failing ${CDASH_URL}"
elif [[ ${TESTS_FAILING} != "0" ]]; then
echo "::set-output name=COMMENT_BODY::${COMMIT_SHA} :fire: ${TESTS_FAILING} unit-tests are failing ${CDASH_URL}"
elif [[ ${RUNNERS_OUTCOME} != "success" ]]; then
echo "::set-output name=COMMENT_BODY::${COMMIT_SHA} :broken_heart: QGIS runners test failed"
else

0 comments on commit 7bc0f19

Please sign in to comment.