Skip to content

Commit 68e53e6

Browse files
authored
Add a job to test doc building (for realsies this time) (huggingface#14662)
1 parent e980012 commit 68e53e6

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/build_doc_test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Documentation test build
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "src/**"
7+
- "docs/**"
8+
- ".github/**"
9+
10+
jobs:
11+
build_and_package:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Loading cache.
21+
uses: actions/cache@v2
22+
id: cache
23+
with:
24+
path: ~/.cache/pip
25+
key: v1-test_build_doc
26+
restore-keys: |
27+
v1-test_build_doc-${{ hashFiles('setup.py') }}
28+
v1-test_build_doc
29+
30+
- name: Setup environment
31+
run: |
32+
sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev
33+
34+
pip install git+https://github.com/huggingface/doc-builder
35+
pip install git+https://github.com/huggingface/transformers#egg=transformers[dev]
36+
37+
export TORCH_VERSION=$(python -c "from torch import version; print(version.__version__.split('+')[0])")
38+
pip install torch-scatter -f https://data.pyg.org/whl/torch-${TORCH_VERSION}+cpu.html
39+
40+
pip install torchvision
41+
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
42+
43+
sudo apt install tesseract-ocr
44+
pip install pytesseract
45+
pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com
46+
47+
- name: Make documentation
48+
run: |
49+
doc-builder build transformers ./transformers/docs/source

0 commit comments

Comments
 (0)