forked from Lightning-Universe/lightning-flash
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (87 loc) · 3.08 KB
/
docs-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: "Check Docs"
# https://github.com/marketplace/actions/sphinx-build
on: # Trigger the workflow on push or pull request, but only for the master branch
push: {}
pull_request:
branches: [master]
jobs:
make-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: 3.7
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python --version
pip --version
pip install . --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install --requirement ./requirements/docs.txt
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
pip list
shell: bash
- name: Make Documentation
run: |
# First run the same pipeline as Read-The-Docs
cd docs
make clean
make html --debug --jobs 2 SPHINXOPTS="-W --keep-going"
- name: Upload built docs
uses: actions/upload-artifact@v2
with:
name: docs-results-${{ github.sha }}
path: docs/build/html/
# Use always() to always run this step to publish test results when there are test failures
if: success()
test-docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v2
with:
python-version: 3.7
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/base.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install '.[all]' --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install '.[test]' --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install --requirement ./requirements/docs.txt
python --version
pip --version
pip list
shell: bash
- name: Cache datasets
uses: actions/cache@v2
with:
path: |
docs/data
data
key: flash-datasets-docs
- name: Test Documentation
env:
SPHINX_MOCK_REQUIREMENTS: 0
FIFTYONE_DO_NOT_TRACK: true
run: |
# First run the same pipeline as Read-The-Docs
apt-get update && sudo apt-get install -y cmake
cd docs
FLASH_TESTING=1 make doctest