Check releases/2022/3 branch with pre-commit #537
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: [push, pull_request] | |
env: | |
DOXY_VER: '1.9.6' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Build_Doc: | |
if: github.repository == 'openvinotoolkit/openvino' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Clone OpenVINO | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
lfs: true | |
# cache from ccache | |
- name: Cache ccache | |
id: cache_restore | |
uses: actions/cache@v3 | |
with: | |
path: .ccache | |
key: doc-ccache-cache | |
- name: Install ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: doc-ccache-cache | |
save: false | |
# cache from doxygen build | |
- name: Cache doxygen make | |
id: cache_doxygen_make | |
uses: actions/cache@v3 | |
with: | |
path: doxygen-build | |
key: build-doxygen-cache | |
# cache from python packages | |
- name: Cache python requirements | |
id: cache_python_requirements | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: doc-python-requirements | |
- name: Install apt-get tools | |
uses: awalsh128/[email protected] | |
# install doc dependencies | |
with: | |
packages: graphviz texlive liblua5.2-0 | |
version: 3.0 | |
- name: Install dependencies | |
run: | | |
set -e | |
python3 -m pip install -r docs/requirements.txt --user | |
cd docs/openvino_sphinx_theme | |
python3 setup.py install --user | |
cd ../openvino_custom_sphinx_sitemap | |
python3 setup.py install --user | |
cd ../.. | |
# install doxyrest | |
wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.3/doxyrest-2.1.3-linux-amd64.tar.xz | |
tar -xf doxyrest-2.1.3-linux-amd64.tar.xz | |
echo "$(pwd)/doxyrest-2.1.3-linux-amd64/bin/" >> $GITHUB_PATH | |
# install doxygen | |
wget https://www.doxygen.nl/files/doxygen-$DOXY_VER.linux.bin.tar.gz | |
tar -xzf doxygen-$DOXY_VER.linux.bin.tar.gz | |
echo "$(pwd)/doxygen-$DOXY_VER/bin/" >> $GITHUB_PATH | |
- name: CMake doc | |
run: | | |
cmake \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DENABLE_INTEL_MYRIAD_COMMON=OFF \ | |
-DENABLE_DOCS=ON \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-B build | |
- name: Cache documentation | |
id: cache_sphinx_docs | |
uses: actions/cache@v3 | |
with: | |
path: build/docs/_build/.doctrees | |
key: sphinx-docs-cache | |
- name: Build doc | |
run: | | |
cmake --build build --target sphinx_docs -j`nproc` | |
- name: Archive HTML | |
run: | | |
zip -r openvino_html.zip _build | |
working-directory: build/docs | |
- name: Run Pytest | |
run: | | |
pytest --doxygen="./build/docs/doxygen.log" \ | |
--include_pot \ | |
--sphinx="./build/docs/sphinx.log" \ | |
--suppress-warnings="./docs/suppress_warnings.txt" \ | |
--confcutdir="./docs/scripts/tests/" \ | |
--html="./build/docs/_artifacts/doc-generation.html" \ | |
--doxygen-strip="$(pwd)" \ | |
--sphinx-strip="$(pwd)/build/docs/rst" \ | |
--doxygen-xfail="./docs/doxygen-xfail.txt" \ | |
--self-contained-html ./docs/scripts/tests/test_docs.py | |
- name: 'Upload test results' | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: openvino_doc_pytest | |
path: build/docs/_artifacts/ | |
- name: 'Upload doxygen.log' | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: doxygen_log | |
path: build/docs/doxygen.log | |
- name: 'Upload sphinx.log' | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sphinx_log | |
path: build/docs/sphinx.log | |
- name: 'Upload html' | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: openvino_html | |
path: build/docs/openvino_html.zip |