@@ -16,63 +16,74 @@ defaults:
1616 shell : bash
1717
1818jobs :
19+
20+ build-pypi :
21+ # This serves to create packages for potential internal dependencies
22+ runs-on : ubuntu-20.04
23+ steps :
24+ - uses : actions/checkout@v3
25+ - uses : actions/setup-python@v4
26+ with :
27+ python-version : " 3.8"
28+ - name : Build package
29+ env :
30+ PACKAGE_NAME : " lite"
31+ run : python setup.py sdist
32+ - uses : actions/upload-artifact@v3
33+ with :
34+ name : ci-packages-${{ github.sha }}
35+ path : dist
36+
1937 make-doctest :
2038 runs-on : ubuntu-20.04
21- needs : make-html # make it depending on build docs to reduce load
39+ # make it depending on build docs to reduce load
40+ needs : make-html
2241 strategy :
2342 fail-fast : false
2443 matrix :
2544 pkg : ["app", "pytorch"] # TODO: , "lit"
45+ env :
46+ FREEZE_REQUIREMENTS : " 1"
2647 steps :
2748 - uses : actions/checkout@v3
2849 with :
2950 submodules : true
51+ - uses : actions/download-artifact@v3
52+ with :
53+ name : ci-packages-${{ github.sha }}
54+ path : pypi
3055 - uses : actions/setup-python@v4
3156 with :
32- python-version : 3.9
57+ python-version : " 3.9"
3358
3459 # Note: This uses an internal pip API and may not always work
3560 # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
3661 - name : Cache pip
3762 uses : actions/cache@v3
3863 with :
3964 path : ~/.cache/pip
40- key : ${{ runner.os }}-docs-test-pip -${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
65+ key : ${{ runner.os }}-docs-test-${{ matrix.pkg }} -${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
4166 restore-keys : |
42- ${{ runner.os }}-docs-test-pip -
67+ ${{ runner.os }}-docs-test-${{ matrix.pkg }} -
4368
44- - name : Install lite for PL
45- # Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi
46- # also installing from source not from on-the-fly created package tp prevent accidental interaction with cache
47- if : ${{ matrix.pkg == 'pytorch' }}
48- env :
49- PACKAGE_NAME : " lite"
50- run : |
51- pip install -e . --upgrade --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
52- git checkout -- setup.py MANIFEST.in
53-
54- - name : Install package
55- env :
56- FREEZE_REQUIREMENTS : 1
57- PACKAGE_NAME : ${{ matrix.pkg }}
69+ - name : Install dependencies
5870 run : |
5971 sudo apt-get update
6072 sudo apt-get install -y cmake pandoc
6173 pip --version
62- # python -m pip install --upgrade --user pip
63- pip install -e . \
64- -r requirements/${{ matrix.pkg }}/docs.txt \
65- --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
66- pip list
6774
68- - name : Install dependencies
75+ - name : Install LAI package
76+ # This is needed as App docs is heavily using/referring to lightning package
77+ if : ${{ matrix.pkg == 'app' }}
78+ run : |
79+ pip install -e . -U --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --find-links pypi
80+ git checkout -- setup.py MANIFEST.in
81+
82+ - name : Install this package
6983 env :
70- FREEZE_REQUIREMENTS : 1
71- PACKAGE_NAME : pytorch
84+ PACKAGE_NAME : ${{ matrix.pkg }}
7285 run : |
73- pip install -r requirements/${{ matrix.pkg }}/devel.txt \
74- --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
75- pip list
86+ pip install -e .[extra,cloud,ui] -U -r requirements/${{ matrix.pkg }}/docs.txt --find-links pypi
7687
7788 - name : Test Documentation
7889 env :
@@ -83,38 +94,46 @@ jobs:
8394 make coverage
8495
8596 make-html :
97+ needs : build-pypi
8698 runs-on : ubuntu-20.04
8799 strategy :
88100 fail-fast : false
89101 matrix :
90102 pkg : ["app", "pytorch", "lit"]
103+ env :
104+ FREEZE_REQUIREMENTS : " 1"
91105 steps :
92106 - uses : actions/checkout@v3
93107 with :
94108 submodules : true
95- # lfs: true
109+ - uses : actions/download-artifact@v3
110+ with :
111+ name : ci-packages-${{ github.sha }}
112+ path : pypi
96113 - uses : actions/setup-python@v4
97114 with :
98- python-version : 3.9
115+ python-version : " 3.9"
99116
100117 # Note: This uses an internal pip API and may not always work
101118 # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
102119 - name : Cache pip
103120 uses : actions/cache@v3
104121 with :
105122 path : ~/.cache/pip
106- key : ${{ runner.os }}-docs-make-pip -${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
123+ key : ${{ runner.os }}-docs-make-${{ matrix.pkg }} -${{ hashFiles('requirements/${{ matrix.pkg }}/*.txt') }}
107124 restore-keys : |
108- ${{ runner.os }}-docs-make-pip -
125+ ${{ runner.os }}-docs-make-${{ matrix.pkg }} -
109126
110- - name : Install dependencies
127+ - name : Install package & dependencies
111128 env :
112- FREEZE_REQUIREMENTS : 1
129+ PACKAGE_NAME : ${{ matrix.pkg }}
113130 run : |
114131 sudo apt-get update
115132 sudo apt-get install -y cmake pandoc texlive-latex-extra dvipng texlive-pictures
116133 pip --version
117- pip install -e . --quiet -r requirements/${{ matrix.pkg }}/docs.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
134+ pip install -e . -r requirements/${{ matrix.pkg }}/docs.txt \
135+ --find-links https://download.pytorch.org/whl/cpu/torch_stable.html \
136+ --find-links pypi
118137 pip list
119138 shell : bash
120139
0 commit comments