Skip to content

Commit 8f99fb2

Browse files
committed
ci: doc: add action-zephyr-setup
Setup a fully working Zephyr workspace so that documentation steps that require e.g. building Zephyr apps have the ability to do so. The "turbo" builds running on pull requests get a minimal setup, with no toolchain being installed. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent d76911a commit 8f99fb2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/doc-build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ jobs:
8484
with:
8585
ref: ${{ github.event.pull_request.head.sha }}
8686
fetch-depth: 0
87+
path: zephyr
8788

8889
- name: Rebase
8990
if: github.event_name == 'pull_request'
9091
continue-on-error: true
9192
env:
9293
BASE_REF: ${{ github.base_ref }}
9394
PR_HEAD: ${{ github.event.pull_request.head.sha }}
95+
working-directory: zephyr
9496
run: |
9597
git config --global user.email "[email protected]"
9698
git config --global user.name "Github Actions"
@@ -100,25 +102,21 @@ jobs:
100102
git clean -f -d
101103
git log --graph --oneline HEAD...${PR_HEAD}
102104
103-
- name: cache-pip
104-
uses: actions/cache@v4
105+
- name: Setup Zephyr project
106+
uses: zephyrproject-rtos/action-zephyr-setup@v1
105107
with:
106-
path: ~/.cache/pip
107-
key: pip-${{ hashFiles('doc/requirements.txt') }}
108+
app-path: zephyr
109+
toolchains: ${{ github.event_name != 'pull_request' && 'all' || null }}
108110

109111
- name: install-pip
112+
working-directory: zephyr
110113
run: |
111114
pip install -r doc/requirements.txt
112-
pip install west==${WEST_VERSION}
113-
pip install cmake==${CMAKE_VERSION}
114115
pip install coverxygen
115116
116-
- name: west setup
117-
run: |
118-
west init -l .
119-
120117
- name: build-docs
121118
shell: bash
119+
working-directory: zephyr
122120
run: |
123121
if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then
124122
DOC_TAG="release"
@@ -144,6 +142,7 @@ jobs:
144142
genhtml --no-function-coverage --no-branch-coverage new.info -o coverage-report
145143
146144
- name: compress-docs
145+
working-directory: zephyr
147146
run: |
148147
tar --use-compress-program="xz -T0" -cf html-output.tar.xz --exclude html/_sources --exclude html/doxygen/xml --directory=doc/_build html
149148
tar --use-compress-program="xz -T0" -cf api-output.tar.xz --directory=doc/_build html/doxygen/html
@@ -153,7 +152,7 @@ jobs:
153152
uses: actions/upload-artifact@v4
154153
with:
155154
name: html-output
156-
path: html-output.tar.xz
155+
path: zephyr/html-output.tar.xz
157156

158157
- name: upload-api-coverage
159158
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)