Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/ci-pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: true
max-parallel: 1
matrix:
pkg: ["lite"]
pkg-name: ["lite"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand All @@ -52,7 +52,7 @@ jobs:
path: pypi
- name: Build package
env:
PACKAGE_NAME: ${{ matrix.pkg }}
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
python setup.py sdist
cp dist/* pypi/
Expand All @@ -68,7 +68,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macOS-12, windows-2022]
pkg: ["app", "lite", "pytorch", ""]
pkg-name: ["app", "lite", "pytorch", ""]
python-version: ["3.7" , "3.10"]
steps:
- uses: actions/checkout@v3
Expand All @@ -82,10 +82,10 @@ jobs:
pip install pytest -q
python -m pytest setup_tools.py

- run: python -c "print('NB_DIRS=' + str(2 if '${{ matrix.pkg }}' == 'pytorch' else 1))" >> $GITHUB_ENV
- run: python -c "print('NB_DIRS=' + str(2 if '${{ matrix.pkg-name }}' == 'pytorch' else 1))" >> $GITHUB_ENV
- uses: ./.github/actions/pkg-check
with:
pkg-name: ${{ matrix.pkg }}
pkg-name: ${{ matrix.pkg-name }}
nb-dirs: ${{ env.NB_DIRS }}

- uses: actions/download-artifact@v3
Expand All @@ -99,11 +99,11 @@ jobs:

- name: Run CLI
# todo: add testing for `lightning_app`
if: ${{ matrix.pkg == '' }}
if: ${{ matrix.pkg-name == '' }}
run: python -m lightning --version

- name: DocTest package
run: |
pip list
scope=$(python -c "lut = {'app': 'lightning_app', 'lite': 'lightning_lite', 'pytorch': 'pytorch_lightning'} ; print(lut.get('${{matrix.pkg}}', 'lightning'))")
scope=$(python -c "lut = {'app': 'lightning_app', 'lite': 'lightning_lite', 'pytorch': 'pytorch_lightning'} ; print(lut.get('${{matrix.pkg-name}}', 'lightning'))")
python -m pytest src/${scope} --ignore-glob="**/cli/*-template/**"
36 changes: 19 additions & 17 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pkg: ["app", "pytorch"] # TODO: , "lit"
pkg-name: ["app", "pytorch"] # TODO: , "lit"
env:
FREEZE_REQUIREMENTS: "1"
steps:
Expand All @@ -62,9 +62,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-docs-test-${{ matrix.pkg }}-${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
key: ${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: |
${{ runner.os }}-docs-test-${{ matrix.pkg }}-
${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-

- name: Install dependencies
run: |
Expand All @@ -74,25 +74,27 @@ jobs:

- name: Install LAI package
# This is needed as App docs is heavily using/referring to lightning package
if: ${{ matrix.pkg == 'app' }}
if: ${{ matrix.pkg-name== 'app' }}
run: |
pip install -e . -U --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --find-links pypi
git checkout -- setup.py MANIFEST.in

- name: Adjust examples
if: ${{ matrix.pkg-name == 'lightning' }}
run: python .actions/assistant.py copy_replace_imports --source_dir="./src" --source_import="pytorch_lightning,lightning_lite" --target_import="lightning.pytorch,lightning.lite"
- name: Adjust docs refs
if: ${{ matrix.pkg-name == 'app' }}
run: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py copy_replace_imports --source_dir="./docs" --source_import="pytorch_lightning,lightning_lite" --target_import="lightning.pytorch,lightning.lite"

- name: Install this package
env:
PACKAGE_NAME: ${{ matrix.pkg }}
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg }}/docs.txt --find-links pypi
pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg-name }}/docs.txt --find-links pypi

- name: Test Documentation
env:
SPHINX_MOCK_REQUIREMENTS: 0
working-directory: ./docs/source-${{ matrix.pkg }}
working-directory: ./docs/source-${{ matrix.pkg-name }}
run: |
make doctest
make coverage
Expand All @@ -103,7 +105,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pkg: ["app", "pytorch", "lit"]
pkg-name: ["app", "pytorch", "lit"]
env:
FREEZE_REQUIREMENTS: "1"
steps:
Expand All @@ -124,32 +126,32 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-docs-make-${{ matrix.pkg }}-${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
key: ${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: |
${{ runner.os }}-docs-make-${{ matrix.pkg }}-
${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-

- name: Install package & dependencies
env:
PACKAGE_NAME: ${{ matrix.pkg }}
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
sudo apt-get update
sudo apt-get install -y cmake pandoc texlive-latex-extra dvipng texlive-pictures
pip --version
pip install -e . -r requirements/${{ matrix.pkg }}/docs.txt \
pip install -e . -r requirements/${{ matrix.pkg-name }}/docs.txt \
--find-links https://download.pytorch.org/whl/cpu/torch_stable.html \
--find-links pypi
pip list
shell: bash

- name: Make Documentation
working-directory: ./docs/source-${{ matrix.pkg }}
working-directory: ./docs/source-${{ matrix.pkg-name }}
run: |
make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"

- name: Upload built docs
uses: actions/upload-artifact@v3
with:
name: docs-${{ matrix.pkg }}-${{ github.sha }}
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
path: docs/build/html/
# Use always() to always run this step to publish test results when there are test failures
if: success()