From 35bbd7831ec12d09dba4df7d3b95dab26b471e05 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 17 May 2021 13:43:59 +0200 Subject: [PATCH] If there was a problem in doc_with_postprocessing, stop the process qand post a comment with the issues --- .github/workflows/build_doc.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_doc.yml b/.github/workflows/build_doc.yml index 3eb50310963..40c2a7a4c33 100644 --- a/.github/workflows/build_doc.yml +++ b/.github/workflows/build_doc.yml @@ -50,7 +50,7 @@ jobs: run: | set -x sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html - sudo pip install lxml + sudo pip install lxml sudo pip install 'pyquery==1.4.1' # it seems to be the last py2 compatible version wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen sudo mv doxygen_exe /usr/bin/doxygen @@ -65,6 +65,7 @@ jobs: mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc - name: Build and Upload Doc + id: build_and_run if: steps.get_round.outputs.result != 'stop' run: | set -ex @@ -77,7 +78,13 @@ jobs: if [ "$LIST_OF_PKGS" = "" ]; then exit 1 fi - cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing + cd build_doc && make -j2 doc + make -j2 doc_with_postprocessing 2>tmp.log + if [ -s tmp.log ]; then + content=`cat ./build_doc/tmp.log` + echo ::set-output name=DoxygenError::$(cat tmp.log) + exit 1 + fi cd .. git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git mkdir -p cgal.github.io/${PR_NUMBER}/$ROUND @@ -99,7 +106,7 @@ jobs: - name: Post address uses: actions/github-script@v3 - if: steps.get_round.outputs.result != 'stop' + if: ${{ success() && steps.get_round.outputs.result != 'stop' }} with: script: | const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/${{ steps.get_round.outputs.result }}/Manual/index.html" @@ -109,3 +116,17 @@ jobs: issue_number: ${{ github.event.issue.number }}, body: address }); + + - name: Post error + uses: actions/github-script@v3 + if: ${{ failure() && steps.get_round.outputs.result != 'stop' }} + with: + script: | + const error = "${{steps.build_and_run.outputs.DoxygenError}}" + const msg = "There was an error while building the doc: \n"+error + github.issues.createComment({ + owner: "CGAL", + repo: "cgal", + issue_number: ${{ github.event.issue.number }}, + body: msg + });