From d87280f7521ec8c1739cf4622b7b519fdca704e4 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Tue, 2 Feb 2021 15:55:18 +0100 Subject: [PATCH] post comment with CDASH url when tests are failing --- .ci/config.ctest | 4 ++-- .github/workflows/run-tests.yml | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.ci/config.ctest b/.ci/config.ctest index c07e3e4459a..8f194937f28 100644 --- a/.ci/config.ctest +++ b/.ci/config.ctest @@ -67,7 +67,7 @@ IF(NOT IGNORE_BUILD_FAILURES) MESSAGE(" ${Yellow}Test results submitted to${ColorReset}") MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}") # Github workflow output - MESSAGE("::set-output name=CDASH_URL::${SHORTURL}$") + MESSAGE("::set-output name=CDASH_URL::${SHORTURL}") MESSAGE("") MESSAGE( FATAL_ERROR " ${Red}Build failed. Not running tests.${ColorReset}" ) MESSAGE("") @@ -80,7 +80,7 @@ IF(NOT ${NUMWARN} EQUAL 0 OR NOT ${TESTRES} EQUAL 0) MESSAGE(" ${Yellow}Test results submitted to${ColorReset}") MESSAGE(" ${BoldYellow}${SHORTURL}${ColorReset}" ) # Github workflow output - MESSAGE("::set-output name=CDASH_URL::${SHORTURL}$") + MESSAGE("::set-output name=CDASH_URL::${SHORTURL}") MESSAGE("") SET(LEVEL "") IF(NOT ${TESTRES} EQUAL 0) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4bcba68e8c5..008a983a351 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -160,6 +160,15 @@ jobs: name: Publish link to CDASH needs: build runs-on: ubuntu-latest - if: failure() + if: failure() and github.event_name == 'pull_request' steps: - run: echo "${{ needs.build.outputs.cdash_url }}" + + - name: Create comment + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ steps.token.outputs.token }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Some tests are failing. + Tests results: ${{ needs.build.outputs.cdash_url }}