post comment with CDASH url when tests are failing

This commit is contained in:
Denis Rouzaud 2021-02-02 15:55:18 +01:00 committed by Nyall Dawson
parent 3004f3bfb6
commit d87280f752
2 changed files with 12 additions and 3 deletions

View File

@ -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)

View File

@ -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 }}