-
Notifications
You must be signed in to change notification settings - Fork 6
98 lines (78 loc) · 2.66 KB
/
documentation.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
name: Documentation and Code Coverage
on:
push:
pull_request:
types:
- closed
branches:
- main
jobs:
run:
name: Build documentation on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: tlylt/install-graphviz@v1
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Install requirements dev
run: python -m pip install -r requirements-dev.txt
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Build
run: python setup.py build_ext --inplace --use-cuda=0
- name: cat _config.py
run: cat onnx_extended/_config.py
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
export PYTHONPATH=.
export SKIP_UNSTABLE=1
pytest --cov=./onnx_extended/ --cov-report=xml --durations=10 --ignore-glob=**LONG*.py --ignore-glob=**notebook*.py
export PYTHONPATH=
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Install
run: python setup.py install
- name: HAS_CUDA?
run: python -c "import onnx_extended;print('has_cuda:',onnx_extended.has_cuda())"
- name: Copy license, changelogs
run: |
cp LICENSE* ./_doc
cp CHANGELOGS* ./_doc
- name: Documentation
run: python -m sphinx ./_doc ./dist/html -n -w doc.txt
- name: Summary
run: cat doc.txt
- name: Check for errors and warnings
run: |
if [[ $(grep ERROR doc.txt | grep -v 'validation.cuda' | grep -v 'pickable') ]]; then
echo "Documentation produces errors."
grep ERROR doc.txt | grep -v 'validation.cuda' | grep -v 'pickable'
exit 1
fi
if [[ $(grep WARNING doc.txt | grep -v 'validation.cuda' | grep -v 'pickable') ]]; then
echo "Documentation produces warnings."
grep WARNING doc.txt | grep -v 'validation.cuda' | grep -v 'pickable'
exit 1
fi
- uses: actions/upload-artifact@v3
with:
path: ./dist/html/**