2022-02-02 19:48:15 +00:00
|
|
|
name: Check Docs
|
2020-06-27 20:25:33 +00:00
|
|
|
# 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
|
|
|
|
2022-02-02 19:48:15 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
|
|
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
|
|
|
2020-06-27 20:25:33 +00:00
|
|
|
jobs:
|
2021-11-10 16:59:10 +00:00
|
|
|
doctest:
|
2020-06-27 20:25:33 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2020-11-04 09:08:37 +00:00
|
|
|
- uses: actions/checkout@v2
|
2021-06-08 16:30:13 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
2020-06-27 20:25:33 +00:00
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-10-26 11:58:20 +00:00
|
|
|
python-version: 3.9
|
2020-06-27 20:25:33 +00:00
|
|
|
|
2022-03-23 09:14:29 +00:00
|
|
|
- name: Reset caching
|
|
|
|
run: python -c "import time; days = time.time() / 60 / 60 / 24; print(f'TIME_PERIOD=d{int(days / 2) * 2}')" >> $GITHUB_ENV
|
2021-05-25 22:53:38 +00:00
|
|
|
|
2020-06-27 20:25:33 +00:00
|
|
|
# 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
|
2022-05-12 13:14:18 +00:00
|
|
|
key: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-${{ hashFiles('requirements/base.txt') }}
|
2020-06-27 20:25:33 +00:00
|
|
|
restore-keys: |
|
2022-03-27 15:42:01 +00:00
|
|
|
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-06-08 16:30:13 +00:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y cmake pandoc
|
2021-03-05 20:39:52 +00:00
|
|
|
pip --version
|
2022-03-11 11:13:43 +00:00
|
|
|
pip install -q fire
|
2020-06-27 20:25:33 +00:00
|
|
|
# python -m pip install --upgrade --user pip
|
2022-05-12 13:14:18 +00:00
|
|
|
pip install -r requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
|
|
|
|
pip install -r requirements/devel.txt
|
|
|
|
pip install -r 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
|
2021-06-08 16:30:13 +00:00
|
|
|
working-directory: ./docs
|
2020-06-27 20:25:33 +00:00
|
|
|
run: |
|
|
|
|
# First run the same pipeline as Read-The-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
|
2021-06-08 16:30:13 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
# lfs: true
|
2020-06-27 20:25:33 +00:00
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-10-26 11:58:20 +00:00
|
|
|
python-version: 3.9
|
2020-06-27 20:25:33 +00:00
|
|
|
|
|
|
|
# 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
|
2022-05-12 13:14:18 +00:00
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/base.txt') }}
|
2020-06-27 20:25:33 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2021-06-08 16:30:13 +00:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y cmake pandoc
|
2021-03-05 20:39:52 +00:00
|
|
|
pip --version
|
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
|
2021-06-08 16:30:13 +00:00
|
|
|
working-directory: ./docs
|
2020-06-27 20:25:33 +00:00
|
|
|
run: |
|
|
|
|
# First run the same pipeline as Read-The-Docs
|
2021-03-23 07:51:45 +00:00
|
|
|
make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
|
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()
|