forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (88 loc) · 2.77 KB
/
docbuild.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: Documentation Build
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
with:
path: ncs/nrf
fetch-depth: 0
- name: cache-pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-doc-pip
- name: Install packages
run: |
sudo apt-get install -y ninja-build doxygen mscgen sshpass
- name: Install base dependencies
working-directory: ncs
run: |
pip3 install -U pip
pip3 install -U setuptools
export PATH="$HOME/.local/bin:$PATH"
pip3 install -r nrf/scripts/requirements-base.txt
- name: West init and update
working-directory: ncs
run: |
export PATH="$HOME/.local/bin:$PATH"
west init -l nrf
west update
west zephyr-export
- name: Install documentation dependencies
working-directory: ncs
run: |
pip3 install -r zephyr/scripts/requirements-doc.txt
pip3 install -r nrf/scripts/requirements-doc.txt
- name: Build documentation
working-directory: ncs
run: |
export PATH="$HOME/.local/bin:$PATH"
mkdir -p _build && cd _build
cmake -GNinja ../nrf/doc
ninja build-all
- name: Check build warnings
working-directory: ncs
run: |
cd _build
if [ -s Kconfig/sphinx.log ]; then
errors=$(cat Kconfig/sphinx.log)
echo "::error file=Kconfig/sphinx.log::$errors"
exit 1
fi
if [ -s zephyr/doc.warnings ]; then
errors=$(cat zephyr/doc.warnings)
echo "::error file=zephyr/doc.warnings::$errors"
exit 1
fi
if [ -s mcuboot/sphinx.log ]; then
errors=$(cat mcuboot/sphinx.log)
echo "::error file=mcuboot/sphinx.log::$errors"
exit 1
fi
if [ -s nrf/doc.warnings ]; then
errors=$(cat nrf/doc.warnings)
echo "::error file=nrf/doc.warnings::$errors"
exit 1
fi
if [ -s nrfxlib/doc.log ]; then
errors=$(cat nrfxlib/doc.log)
echo "::error file=nrfxlib/doc.log::$errors"
exit 1
fi
- name: Archive documentation
working-directory: ncs/_build
run: |
# FIXME: must be updated once push (master) is added to events
mkdir pr && cd pr
tar -C ../html -zcf doc_build_pr-${{ github.event.number }}.tar.gz .
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: pr
path: ncs/_build/pr/