Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: unify docs makes flows #162

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
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
71 changes: 35 additions & 36 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check docs flow
name: Building docs

on:
workflow_call:
Expand All @@ -13,11 +13,6 @@ on:
default: './docs'
required: false
type: string
doctest:
description: 'test examples inside docs'
default: true
required: false
type: boolean
timeout-minutes:
description: 'timeout-minutes for each job'
default: 15
Expand All @@ -36,6 +31,17 @@ on:
{
"SPHINX_MOCK_REQUIREMENTS": 0,
}
make-target:
description: 'what test configs to run in json format'
required: false
type: string
default: |
["html", "doctest", "linkcheck"]
install-tex:
description: 'optional installing Texlive support'
required: false
type: boolean
default: false

defaults:
run:
Expand All @@ -46,10 +52,13 @@ env:

jobs:

docs-test:
make-docs:
runs-on: ubuntu-20.04
env: ${{ fromJSON(inputs.env-vars) }}
if: inputs.doctests != 'false'
strategy:
fail-fast: false
matrix:
check: ${{ fromJSON(inputs.make-target) }}
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
Expand All @@ -61,55 +70,45 @@ jobs:
with:
python-version: ${{ inputs.python-version }}

- name: Install pandoc & texlive
if: inputs.install-tex == 'true'
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y pandoc texlive-latex-extra dvipng texlive-pictures
# todo: consider adding cache with separate restore/dave
- name: Install dependencies
run: |
pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL}
pip --version
pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL}
pip list
shell: bash

# TODO: re-enable after the external usage is resolved, see #51
# - uses: ./.github/actions/pip-list

- name: Test Documentation
if: ${{ matrix.check == 'doctest' }}
working-directory: ${{ inputs.docs-dir }}
env:
SPHINX_MOCK_REQUIREMENTS: 0
run: |
make doctest
make coverage


docs-html:
runs-on: ubuntu-20.04
env: ${{ fromJSON(inputs.env-vars) }}
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python 🐍 ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
pip install -e . -U -r ${{ inputs.requirements-file }} -f ${TORCH_URL}
sudo apt-get update --fix-missing
sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
python --version
pip --version
pip list
- name: Check External Links
if: ${{ matrix.check == 'linkcheck' }}
working-directory: ${{ inputs.docs-dir }}
run: make linkcheck SPHINXOPTS="--keep-going"

- name: Build documentation
if: ${{ matrix.check == 'html' }}
working-directory: ${{ inputs.docs-dir }}
run: make html --debug SPHINXOPTS="-W --keep-going"

- name: Keep artifact
id: keep-artifact
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
- name: Upload built docs
if: ${{ matrix.check == 'html' }}
uses: actions/upload-artifact@v3
with:
name: docs-${{ github.sha }}
path: ${{ inputs.docs-dir }}/build/html/
if: success()
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updated/Extended the `requires` wrapper ([#146](https://github.com/Lightning-AI/utilities/pull/146))


- CI: unified/extended docs makes flows ([#162](https://github.com/Lightning-AI/utilities/pull/162))


### Fixed

- Fixed issue with `is_overridden` falsely returning True when the parent method is wrapped ([#149](https://github.com/Lightning-AI/utilities/pull/149))
Expand Down