If there was a problem in doc_with_postprocessing, stop the process qand post a comment with the issues

This commit is contained in:
Maxime Gimeno 2021-05-17 13:43:59 +02:00
parent ae4f358dc1
commit 35bbd7831e
1 changed files with 24 additions and 3 deletions

View File

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