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

@ -50,7 +50,7 @@ jobs:
run: | run: |
set -x set -x
sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html 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 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 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 sudo mv doxygen_exe /usr/bin/doxygen
@ -65,6 +65,7 @@ jobs:
mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc
- name: Build and Upload Doc - name: Build and Upload Doc
id: build_and_run
if: steps.get_round.outputs.result != 'stop' if: steps.get_round.outputs.result != 'stop'
run: | run: |
set -ex set -ex
@ -77,7 +78,13 @@ jobs:
if [ "$LIST_OF_PKGS" = "" ]; then if [ "$LIST_OF_PKGS" = "" ]; then
exit 1 exit 1
fi 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 .. cd ..
git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git 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 mkdir -p cgal.github.io/${PR_NUMBER}/$ROUND
@ -99,7 +106,7 @@ jobs:
- name: Post address - name: Post address
uses: actions/github-script@v3 uses: actions/github-script@v3
if: steps.get_round.outputs.result != 'stop' if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
with: with:
script: | 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" 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 }}, issue_number: ${{ github.event.issue.number }},
body: address 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
});