ci: simplify/unify make docs targets (#18795)
This commit is contained in:
parent
e0f2be0055
commit
a001779b17
|
@ -41,9 +41,10 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
pkg-name: ["app", "fabric", "pytorch"]
|
pkg-name: ["app", "fabric", "pytorch"]
|
||||||
check: ["html", "doctest", "linkcheck"]
|
target: ["html", "doctest", "linkcheck"]
|
||||||
env:
|
env:
|
||||||
DOCS_COPY_NOTEBOOKS: 1
|
DOCS_COPY_NOTEBOOKS: 1
|
||||||
|
ARTIFACT_DAYS: 0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@ -69,7 +70,7 @@ jobs:
|
||||||
if: ${{ matrix.pkg-name == 'pytorch' }}
|
if: ${{ matrix.pkg-name == 'pytorch' }}
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update --fix-missing
|
||||||
sudo apt-get install -y pandoc texlive-latex-extra dvipng texlive-pictures
|
sudo apt-get install -y pandoc texlive-latex-extra dvipng texlive-pictures
|
||||||
- name: Install package & dependencies
|
- name: Install package & dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
|
@ -84,37 +85,23 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: pip install -q -r _notebooks/.actions/requires.txt
|
run: pip install -q -r _notebooks/.actions/requires.txt
|
||||||
|
|
||||||
- name: Test Examples in Docs
|
|
||||||
if: ${{ matrix.check == 'doctest' }}
|
|
||||||
working-directory: ./docs/source-${{ matrix.pkg-name }}
|
|
||||||
run: |
|
|
||||||
make doctest
|
|
||||||
make coverage
|
|
||||||
|
|
||||||
- name: Check External Links
|
|
||||||
if: ${{ matrix.check == 'linkcheck' }}
|
|
||||||
working-directory: ./docs/source-${{ matrix.pkg-name }}
|
|
||||||
run: make linkcheck SPHINXOPTS="--keep-going"
|
|
||||||
|
|
||||||
- name: Full build for deployment
|
- name: Full build for deployment
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
|
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
|
||||||
- name: Make Documentation
|
- name: Make ${{ matrix.target }}
|
||||||
if: ${{ matrix.check == 'html' }}
|
|
||||||
working-directory: ./docs/source-${{ matrix.pkg-name }}
|
working-directory: ./docs/source-${{ matrix.pkg-name }}
|
||||||
run: make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
|
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
|
||||||
|
|
||||||
- name: Keep artifact
|
- name: Keep artifact
|
||||||
id: keep-artifact
|
if: github.event_name == 'pull_request'
|
||||||
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
|
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload built docs
|
- name: Upload built docs
|
||||||
if: ${{ matrix.check == 'html' }}
|
if: ${{ matrix.target == 'html' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
||||||
path: docs/build/html/
|
path: docs/build/html/
|
||||||
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
|
retention-days: ${{ env.ARTIFACT_DAYS }}
|
||||||
|
|
||||||
- name: Dump handy wheels
|
- name: Dump handy wheels
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
|
|
Loading…
Reference in New Issue