Skip to content

Commit db6b8ce

Browse files
gmarullb-gent
authored andcommitted
doc: refactor doc generation
So that process is similar to NCS. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 316ecab commit db6b8ce

File tree

86 files changed

+977
-353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+977
-353
lines changed

.github/workflows/docs.yml

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,53 @@
11
name: Documentation Build
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on: [push, pull_request]
4+
5+
env:
6+
DOXYGEN_VERSION: 1.12.0
47

58
jobs:
69
build:
710
runs-on: ubuntu-22.04
811
steps:
912
- name: Checkout
1013
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
fetch-depth: 0
17+
path: sdk-nrf-bm/nrf-bm
1118

12-
- name: Install Doxygen
13-
run: sudo apt-get install -y doxygen
19+
- name: Install system dependencies
20+
run: |
21+
sudo apt-get install -y cmake ninja-build
22+
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
23+
sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt
24+
echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
28+
with:
29+
python-version: 3.12
30+
cache: pip
31+
cache-dependency-path: sdk-nrf-bm/nrf-bm/doc/requirements.txt
32+
33+
- name: Install Python dependencies
34+
working-directory: sdk-nrf-bm/nrf-bm
35+
run: |
36+
pip install west
37+
pip install -r doc/requirements.txt
38+
39+
- name: West update
40+
working-directory: sdk-nrf-bm/nrf-bm
41+
run: |
42+
west init -l .
43+
west update -o=--depth=1 -n
44+
west zephyr-export
1445
1546
- name: Build
47+
working-directory: sdk-nrf-bm/nrf-bm
1648
run: |
17-
cd doc/nrf-bm
18-
python3 gen_docs.py
49+
cmake -G Ninja -S doc -B doc/_build
50+
cmake --build doc/_build
1951
2052
- name: Check version
2153
run: |
@@ -31,7 +63,7 @@ jobs:
3163
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
3264
3365
- name: Prepare Azure upload
34-
working-directory: doc/nrf-bm/_build/html
66+
working-directory: sdk-nrf-bm/nrf-bm/doc/_build/html
3567
run: |
3668
MONITOR="monitor_${{ github.run_id }}.txt"
3769
@@ -48,21 +80,21 @@ jobs:
4880
zip -rq "${ARCHIVE}" .
4981
5082
- name: Find nRF Connect SDK Bare Metal Edited Documents
51-
working-directory: doc
83+
working-directory: sdk-nrf-bm/nrf-bm
5284
run: |
5385
COMMENT="comment.txt"
5486
PREFIX="https://ncsbmdoc.z6.web.core.windows.net/PR-${{ github.event.pull_request.number }}/"
5587
5688
echo "You can find the documentation preview for this PR [here](${PREFIX})." >> $COMMENT
5789
5890
- name: Stage files for publish
91+
working-directory: sdk-nrf-bm/nrf-bm
5992
run: |
60-
rm -rf publish
61-
mkdir -p publish
62-
cp doc/nrf-bm/_build/html/monitor_*.txt publish/
63-
cp doc/nrf-bm/_build/html/*.zip publish/
64-
if [[ -f doc/nrf-bm/_build/html/pr.txt ]]; then cp doc/nrf-bm/_build/html/pr.txt publish/; fi
65-
cp doc/comment.txt publish/
93+
mkdir publish
94+
cp doc/_build/html/monitor_*.txt publish/
95+
cp doc/_build/html/*.zip publish/
96+
if [[ -f doc/_build/html/pr.txt ]]; then cp doc/_build/html/pr.txt publish/; fi
97+
cp comment.txt publish/
6698
6799
- name: Store
68100
if: ${{ !contains(github.event.pull_request.labels.*.name, 'external') || contains(github.event.pull_request.labels.*.name, 'CI-trusted-author') }}
@@ -71,4 +103,4 @@ jobs:
71103
name: docs
72104
retention-days: 5
73105
path: |
74-
publish/*
106+
sdk-nrf-bm/nrf-bm/publish/*

0 commit comments

Comments
 (0)