diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 7f8f5eedbcb..f6ca0fbe79f 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -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 @@ -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 @@ -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 }} @@ -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