Skip to content

Commit

Permalink
ci/docs: primary installation of fetch template (Lightning-AI#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored and matsumotosan committed Oct 14, 2023
1 parent 87c092c commit 7a8450f
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
check: [html, doctest, linkcheck]
target: [html, doctest, linkcheck]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -48,7 +48,7 @@ jobs:
pypi-dir: ${{ env.PYPI_CACHE }}

- name: Install Latex
if: ${{ matrix.check == 'html' }}
if: ${{ matrix.target == 'html' }}
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
run: |
sudo apt-get update --fix-missing
Expand All @@ -59,42 +59,27 @@ jobs:
run: |
pip install awscli
aws s3 sync --no-sign-request s3://sphinx-packages/ dist/
pip install lai-sphinx-theme -U -f dist/
- name: Install package & dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y cmake
pip --version
pip install . -U -r requirements/_docs.txt \
--find-links="${PYPI_CACHE}" --find-links="${TORCH_URL}" --find-links="dist/"
--find-links="dist/" --find-links="${PYPI_CACHE}" --find-links="${TORCH_URL}"
pip list
- name: Test Examples in Documentation
if: ${{ matrix.check == 'doctest' }}
working-directory: ./docs
run: |
make doctest --debug --jobs $(nproc)
make coverage
- name: Check External Links
if: ${{ matrix.check == 'linkcheck' }}
working-directory: ./docs
env:
SPHINX_MOCK_REQUIREMENTS: 1
run: make linkcheck --jobs $(nproc) SPHINXOPTS="--keep-going"

- name: Full build for deployment
if: github.event_name != 'pull_request'
run: echo "SPHINX_FETCH_ASSETS=1" >> $GITHUB_ENV
- name: Make Documentation
if: ${{ matrix.check == 'html' }}
- name: make ${{ matrix.target }}
if: ${{ matrix.target != 'html' }}
working-directory: ./docs
run: make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"

- name: Upload built docs
if: ${{ matrix.check == 'html' && github.event_name == 'push' }}
if: ${{ matrix.target == 'html' && github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: docs-${{ github.sha }}
name: docs-${{ matrix.target }}-${{ github.sha }}
path: docs/build/
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}

Expand All @@ -114,7 +99,7 @@ jobs:
steps:
- uses: actions/download-artifact@v3
with:
name: docs-${{ github.sha }}
name: docs-html-${{ github.sha }}
path: docs/build/

- name: Authenticate to Google Cloud
Expand Down

0 comments on commit 7a8450f

Please sign in to comment.