Skip to content

Merge pull request #1707 from peterleimbach/master #698

Merge pull request #1707 from peterleimbach/master

Merge pull request #1707 from peterleimbach/master #698

name: Build Warnings
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [en, fr, de, nl, cs, el, es, ko, lt, ru, tr, he]
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install packages
run: |
python -m pip install --exists-action=w --no-cache-dir -r requirements.rtd.txt
python -m pip install --exists-action=w --no-cache-dir -r requirements.txt
- name: Set doc Path
run: |
if [ '${{ matrix.language }}' == 'en' ]
then
echo "DOC_PATH=docs/EN/" >> $GITHUB_ENV
else
echo "DOC_PATH=docs/CROWDIN/${{ matrix.language }}/" >> $GITHUB_ENV
fi
- name: Show Sphinx conf
run: |
cat ${{ env.DOC_PATH }}conf.py
cat docs/shared.conf.py
- name: Build docs
run: |
cd ${{ env.DOC_PATH }}
sphinx-build -T -E -n -v -w build_log.txt -q -b html -d _build/doctrees . _build/html
- name: Store build log
uses: actions/upload-artifact@v2
with:
name: build_log_${{ matrix.language }}
path: ${{ env.DOC_PATH }}build_log.txt
badge:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
language: [en, fr, de, nl, cs, el, es, ko, lt, ru, tr, he]
steps:
- name: Get build log
uses: actions/download-artifact@v2
with:
name: build_log_${{ matrix.language }}
- name: Process - Build results
run: |
COUNT=$(wc -l < build_log.txt)
if [ $COUNT == 0 ]
then
echo "MESSAGE=OK" >> $GITHUB_ENV
echo "COLOR=green" >> $GITHUB_ENV
else
echo Number of warning $COUNT
echo "MESSAGE=$COUNT" >> $GITHUB_ENV
echo "COLOR=red" >> $GITHUB_ENV
fi
- if: ${{ always() }}
name: Create Badge - Build warnings
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 4d086495590ccb904468b66aecc48bdb
filename: AndroidAPSdocs_build_warnings_${{ matrix.language }}_master.json
label: Warnings - ${{ matrix.language }}
message: ${{ env.MESSAGE }}
color: ${{ env.COLOR }}
namedLogo: read the docs