Skip to content

Commit 3aafbea

Browse files
Bordalantiga
authored andcommitted
ci: simplify/unify make docs targets (#18795)
(cherry picked from commit a001779)
1 parent 700a13a commit 3aafbea

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

.github/workflows/docs-build.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
pkg-name: ["app", "fabric", "pytorch"]
44-
check: ["html", "doctest", "linkcheck"]
44+
target: ["html", "doctest", "linkcheck"]
4545
env:
4646
DOCS_COPY_NOTEBOOKS: 1
47+
ARTIFACT_DAYS: 0
4748
steps:
4849
- uses: actions/checkout@v4
4950
with:
@@ -69,7 +70,7 @@ jobs:
6970
if: ${{ matrix.pkg-name == 'pytorch' }}
7071
timeout-minutes: 5
7172
run: |
72-
sudo apt-get update
73+
sudo apt-get update --fix-missing
7374
sudo apt-get install -y pandoc texlive-latex-extra dvipng texlive-pictures
7475
- name: Install package & dependencies
7576
timeout-minutes: 20
@@ -84,37 +85,23 @@ jobs:
8485
timeout-minutes: 10
8586
run: pip install -q -r _notebooks/.actions/requires.txt
8687

87-
- name: Test Examples in Docs
88-
if: ${{ matrix.check == 'doctest' }}
89-
working-directory: ./docs/source-${{ matrix.pkg-name }}
90-
run: |
91-
make doctest
92-
make coverage
93-
94-
- name: Check External Links
95-
if: ${{ matrix.check == 'linkcheck' }}
96-
working-directory: ./docs/source-${{ matrix.pkg-name }}
97-
run: make linkcheck SPHINXOPTS="--keep-going"
98-
9988
- name: Full build for deployment
10089
if: github.event_name == 'push'
10190
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
102-
- name: Make Documentation
103-
if: ${{ matrix.check == 'html' }}
91+
- name: Make ${{ matrix.target }}
10492
working-directory: ./docs/source-${{ matrix.pkg-name }}
105-
run: make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
93+
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
10694

10795
- name: Keep artifact
108-
id: keep-artifact
109-
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
110-
96+
if: github.event_name == 'pull_request'
97+
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
11198
- name: Upload built docs
112-
if: ${{ matrix.check == 'html' }}
99+
if: ${{ matrix.target == 'html' }}
113100
uses: actions/upload-artifact@v3
114101
with:
115102
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
116103
path: docs/build/html/
117-
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
104+
retention-days: ${{ env.ARTIFACT_DAYS }}
118105

119106
- name: Dump handy wheels
120107
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

0 commit comments

Comments
 (0)