4848 strategy :
4949 fail-fast : false
5050 matrix :
51- pkg : ["app", "pytorch"] # TODO: , "lit"
51+ pkg-name : ["app", "pytorch"] # TODO: , "lit"
5252 env :
5353 FREEZE_REQUIREMENTS : " 1"
5454 steps :
6969 uses : actions/cache@v3
7070 with :
7171 path : ~/.cache/pip
72- key : ${{ runner.os }}-docs-test-${{ matrix.pkg }}-${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
72+ key : ${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
7373 restore-keys : |
74- ${{ runner.os }}-docs-test-${{ matrix.pkg }}-
74+ ${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-
7575
7676 - name : Install dependencies
7777 run : |
@@ -81,25 +81,27 @@ jobs:
8181
8282 - name : Install LAI package
8383 # This is needed as App docs is heavily using/referring to lightning package
84- if : ${{ matrix.pkg == 'app' }}
84+ if : ${{ matrix.pkg-name == 'app' }}
8585 run : |
8686 pip install -e . -U --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --find-links pypi
8787 git checkout -- setup.py MANIFEST.in
8888
89- - name : Adjust examples
90- if : ${{ matrix.pkg-name == 'lightning' }}
91- run : python .actions/assistant.py copy_replace_imports --source_dir="./src" --source_import="pytorch_lightning,lightning_lite" --target_import="lightning.pytorch,lightning.lite"
89+ - name : Adjust docs refs
90+ if : ${{ matrix.pkg-name == 'app' }}
91+ run : |
92+ pip install -q -r .actions/requirements.txt
93+ python .actions/assistant.py copy_replace_imports --source_dir="./docs" --source_import="pytorch_lightning,lightning_lite" --target_import="lightning.pytorch,lightning.lite"
9294
9395 - name : Install this package
9496 env :
95- PACKAGE_NAME : ${{ matrix.pkg }}
97+ PACKAGE_NAME : ${{ matrix.pkg-name }}
9698 run : |
97- pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg }}/docs.txt --find-links pypi
99+ pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg-name }}/docs.txt --find-links pypi
98100
99101 - name : Test Documentation
100102 env :
101103 SPHINX_MOCK_REQUIREMENTS : 0
102- working-directory : ./docs/source-${{ matrix.pkg }}
104+ working-directory : ./docs/source-${{ matrix.pkg-name }}
103105 run : |
104106 make doctest
105107 make coverage
@@ -110,7 +112,7 @@ jobs:
110112 strategy :
111113 fail-fast : false
112114 matrix :
113- pkg : ["app", "pytorch", "lit"]
115+ pkg-name : ["app", "pytorch", "lit"]
114116 env :
115117 FREEZE_REQUIREMENTS : " 1"
116118 steps :
@@ -131,32 +133,32 @@ jobs:
131133 uses : actions/cache@v3
132134 with :
133135 path : ~/.cache/pip
134- key : ${{ runner.os }}-docs-make-${{ matrix.pkg }}-${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
136+ key : ${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
135137 restore-keys : |
136- ${{ runner.os }}-docs-make-${{ matrix.pkg }}-
138+ ${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-
137139
138140 - name : Install package & dependencies
139141 env :
140- PACKAGE_NAME : ${{ matrix.pkg }}
142+ PACKAGE_NAME : ${{ matrix.pkg-name }}
141143 run : |
142144 sudo apt-get update
143145 sudo apt-get install -y cmake pandoc texlive-latex-extra dvipng texlive-pictures
144146 pip --version
145- pip install -e . -r requirements/${{ matrix.pkg }}/docs.txt \
147+ pip install -e . -r requirements/${{ matrix.pkg-name }}/docs.txt \
146148 --find-links https://download.pytorch.org/whl/cpu/torch_stable.html \
147149 --find-links pypi
148150 pip list
149151 shell : bash
150152
151153 - name : Make Documentation
152- working-directory : ./docs/source-${{ matrix.pkg }}
154+ working-directory : ./docs/source-${{ matrix.pkg-name }}
153155 run : |
154156 make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
155157
156158 - name : Upload built docs
157159 uses : actions/upload-artifact@v3
158160 with :
159- name : docs-${{ matrix.pkg }}-${{ github.sha }}
161+ name : docs-${{ matrix.pkg-name }}-${{ github.sha }}
160162 path : docs/build/html/
161163 # Use always() to always run this step to publish test results when there are test failures
162164 if : success()
0 commit comments