Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,29 @@ jobs:
# only Pytorch has/uses notebooks
submodules: ${{ matrix.pkg-name == 'pytorch' }}
lfs: ${{ matrix.pkg-name == 'pytorch' }}
- uses: actions/setup-python@v6

- name: Install uv and set Python version
uses: astral-sh/setup-uv@v6
with:
python-version: "3.10"
# TODO: Avoid activating environment like this
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
activate-environment: true
enable-cache: true

- name: List notebooks
if: ${{ matrix.pkg-name == 'pytorch' }}
working-directory: _notebooks/
run: |
pip install -q py-tree
uv pip install -q py-tree
py-tree .notebooks/
ls -lhR .notebooks/

- name: Pull sphinx template
run: |
pip install -q -r requirements/ci.txt
uv pip install -q -r requirements/ci.txt
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
uv pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}

- name: pip wheels cache
uses: actions/cache/restore@v4
Expand All @@ -101,25 +107,29 @@ jobs:
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y pandoc

- name: Install package & dependencies
timeout-minutes: 20
run: |
mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
ls -lh ${PYPI_CACHE_DIR}
pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
-f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} --extra-index-url="${TORCH_URL}"
pip list
uv pip list

- name: Install req. for Notebooks/tutorials
if: matrix.pkg-name == 'pytorch'
timeout-minutes: 10
run: pip install -q -r _notebooks/.actions/requires.txt
run: uv pip install -q -r _notebooks/.actions/requires.txt

- name: Full build for deployment
if: github.event_name != 'pull_request'
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV

- name: Build without warnings
if: github.event_name != 'workflow_dispatch'
run: echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV

- name: Make ${{ matrix.target }}
working-directory: ./docs/source-${{ matrix.pkg-name }}
# allow failing link check and doctest if you run with dispatch
Expand All @@ -129,6 +139,7 @@ jobs:
- name: Keep artifact
if: github.event_name == 'pull_request'
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV

- name: Upload built docs
if: ${{ matrix.target == 'html' }}
uses: actions/upload-artifact@v4
Expand Down