forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.33 KB
/
link_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
name: link check
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
linkcheck:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Compilation cache
uses: actions/cache@v2
with:
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet.
key: ${{ runner.os }}-ccache-${{ github.sha }}
# Restore any ccache cache entry, if none for
# ${{ runner.os }}-ccache-${{ github.sha }} exists
restore-keys: |
${{ runner.os }}-ccache
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopenblas-dev ninja-build ccache python3-sphinx \
pandoc gcc-7 g++-7 libopencv-dev protobuf-compiler libprotobuf-dev
ccache -M 500M # Limit the ccache size; Github's overall cache limit is 5GB
python -m pip install pandoc-attributes==0.1.7
python -m pip install -r docs/python_docs/requirements
python -m pip install docs/python_docs/themes/mx-theme
shell: bash
- name: Build project
env:
CC: gcc-7
CXX: g++-7
run: |
git submodule update --init --recursive
mkdir build; cd build
CXXFLAGS="-Wno-error=strict-overflow" cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DUSE_ONEDNN=OFF \
-DUSE_CUDA=OFF \
-G Ninja ..
ninja
cd ..
shell: bash
- name: Setup Python
run: |
python -m pip install --user -e python
- name: Link Check
env:
MAX_RETRY: 3
run: |
for run in {1..$MAX_RETRY}
do
cd docs/python_docs/python
make clean
timeout 10m make linkcheck EVAL=0
if [[ $? -eq 0 ]]
then
break
else
if [[ run -eq $MAX_RETRY ]]
then
exit 1
fi
fi
done