2020-02-08 05:20:40 +08:00
|
|
|
# Copyright (c) 2020 Linaro Limited.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-02-08 21:41:47 +08:00
|
|
|
name: Documentation GitHub Workflow
|
2020-02-08 05:20:40 +08:00
|
|
|
|
2020-02-12 11:52:41 +08:00
|
|
|
on: [pull_request]
|
2020-02-08 05:20:40 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Update PATH for west
|
|
|
|
run: |
|
|
|
|
echo "::add-path::$HOME/.local/bin"
|
|
|
|
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: install-pkgs
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y ninja-build doxygen
|
|
|
|
|
|
|
|
- name: cache-pip
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-doc-pip
|
|
|
|
|
|
|
|
- name: install-pip
|
|
|
|
run: |
|
|
|
|
pip3 install setuptools
|
2020-04-08 06:21:25 +08:00
|
|
|
pip3 install 'breathe>=4.9.1,<4.15.0' 'docutils>=0.14' \
|
2020-04-06 06:41:10 +08:00
|
|
|
'sphinx>=1.7.5,<3.0' sphinx_rtd_theme sphinx-tabs \
|
2020-02-08 05:20:40 +08:00
|
|
|
sphinxcontrib-svg2pdfconverter 'west>=0.6.2'
|
2020-03-09 04:48:48 +08:00
|
|
|
pip3 install pyelftools canopen progress
|
2020-02-08 05:20:40 +08:00
|
|
|
|
|
|
|
- name: west setup
|
|
|
|
run: |
|
|
|
|
west init -l . || true
|
|
|
|
|
|
|
|
- name: build-docs
|
|
|
|
run: |
|
|
|
|
source zephyr-env.sh
|
|
|
|
make htmldocs
|
|
|
|
tar cvf htmldocs.tar --directory=./doc/_build html
|
|
|
|
|
|
|
|
- name: upload-build
|
|
|
|
uses: actions/upload-artifact@master
|
|
|
|
continue-on-error: True
|
|
|
|
with:
|
|
|
|
name: htmldocs.tar
|
|
|
|
path: htmldocs.tar
|
|
|
|
|
|
|
|
- name: check-warns
|
|
|
|
run: |
|
|
|
|
if [ -s doc/_build/doc.warnings ]; then
|
|
|
|
docwarn=$(cat doc/_build/doc.warnings)
|
|
|
|
docwarn="${docwarn//'%'/'%25'}"
|
|
|
|
docwarn="${docwarn//$'\n'/'%0A'}"
|
|
|
|
docwarn="${docwarn//$'\r'/'%0D'}"
|
|
|
|
# We treat doc warnings as errors
|
|
|
|
echo "::error file=doc.warnings::$docwarn"
|
|
|
|
exit 1
|
|
|
|
fi
|