2020-06-27 20:25:33 +00:00
name : "Docs check"
# https://github.com/marketplace/actions/sphinx-build
2020-09-15 09:55:03 +00:00
on : # Trigger the workflow on push or pull request, but only for the master branch
push :
2021-01-12 12:56:20 +00:00
branches : [ master, "release/*"]
2020-09-15 09:55:03 +00:00
pull_request :
2020-11-04 09:08:37 +00:00
branches : [ master, "release/*"]
2020-06-27 20:25:33 +00:00
jobs :
2020-11-10 13:57:21 +00:00
sphinx-check :
2020-06-27 20:25:33 +00:00
runs-on : ubuntu-20.04
steps :
- uses : actions/checkout@v2
- uses : ammaraskar/sphinx-action@master
with :
# git is required to clone the docs theme
# before custom requirement are resolved https://github.com/ammaraskar/sphinx-action/issues/16
pre-build-command : "apt-get update -y && apt-get install -y git && pip install -r requirements/docs.txt"
docs-folder : "docs/"
repo-token : "${{ secrets.GITHUB_TOKEN }}"
test-docs :
runs-on : ubuntu-20.04
steps :
2020-11-04 09:08:37 +00:00
- uses : actions/checkout@v2
2020-06-27 20:25:33 +00:00
- uses : actions/setup-python@v2
with :
python-version : 3.7
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name : Cache pip
2020-07-31 10:31:23 +00:00
uses : actions/cache@v2
2020-06-27 20:25:33 +00:00
with :
path : ~/.cache/pip
2020-10-18 18:40:18 +00:00
key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
2020-06-27 20:25:33 +00:00
restore-keys : |
${{ runner.os }}-pip-
- name : Install dependencies
run : |
2021-03-05 20:39:52 +00:00
python --version
pip --version
2021-01-29 16:19:53 +00:00
# remove Horovod from requirements
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)"
2020-06-27 20:25:33 +00:00
# python -m pip install --upgrade --user pip
2020-10-18 18:40:18 +00:00
pip install --requirement requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
2020-06-30 23:35:54 +00:00
pip install --requirement requirements/extra.txt
2020-11-10 13:57:21 +00:00
pip install --requirement requirements/loggers.txt
2020-06-30 23:35:54 +00:00
pip install --requirement requirements/docs.txt
2020-09-30 12:37:52 +00:00
pip list
2020-06-27 20:25:33 +00:00
shell : bash
- name : Test Documentation
2020-06-28 03:31:06 +00:00
env :
SPHINX_MOCK_REQUIREMENTS : 0
2020-06-27 20:25:33 +00:00
run : |
# First run the same pipeline as Read-The-Docs
apt-get update && sudo apt-get install -y cmake
cd docs
make doctest
make coverage
make-docs :
runs-on : ubuntu-20.04
steps :
2020-11-04 09:08:37 +00:00
- uses : actions/checkout@v2
2020-06-27 20:25:33 +00:00
- uses : actions/setup-python@v2
with :
python-version : 3.7
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name : Cache pip
2020-07-31 10:31:23 +00:00
uses : actions/cache@v2
2020-06-27 20:25:33 +00:00
with :
path : ~/.cache/pip
2020-10-18 18:40:18 +00:00
key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
2020-06-27 20:25:33 +00:00
restore-keys : |
${{ runner.os }}-pip-
- name : Install dependencies
run : |
2021-03-05 20:39:52 +00:00
python --version
pip --version
# pip install --requirement requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
2020-06-30 23:35:54 +00:00
pip install --requirement requirements/docs.txt
2020-06-27 20:25:33 +00:00
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
2020-09-30 12:37:52 +00:00
pip list
2020-06-27 20:25:33 +00:00
shell : bash
- name : Make Documentation
run : |
# First run the same pipeline as Read-The-Docs
cd docs
make clean
2021-01-26 20:07:07 +00:00
make html --debug --jobs $(nproc) SPHINXOPTS="-W"
2020-06-27 20:25:33 +00:00
- name : Upload built docs
uses : actions/upload-artifact@v2
with :
2021-01-04 07:38:46 +00:00
name : docs-results-${{ github.sha }}
2020-06-27 20:25:33 +00:00
path : docs/build/html/
# Use always() to always run this step to publish test results when there are test failures
if : success()