Skip to content

Commit f90c7d8

Browse files
committed
ci: workflows: doc: use self-hosted runner
Running full documentation build on GH hosted runners is not really working for us anymore as we run out of disk space. Switch (back) to our self-hosted runners. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent a6c1277 commit f90c7d8

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

.github/workflows/doc-build.yml

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,37 @@ jobs:
5656
needs: [doc-file-check]
5757
if: >
5858
needs.doc-file-check.outputs.file_check == 'true' || github.event_name != 'pull_request'
59-
runs-on: ubuntu-24.04
60-
timeout-minutes: 90
59+
runs-on:
60+
group: zephyr-runner-v2-linux-x64-4xlarge
61+
container:
62+
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.28.4.20250818
63+
options: '--entrypoint /bin/bash'
64+
timeout-minutes: 20
6165
concurrency:
6266
group: doc-build-html-${{ github.ref }}
6367
cancel-in-progress: true
6468

6569
steps:
66-
- name: install-pkgs
70+
71+
- name: Print cloud service information
6772
run: |
68-
sudo apt-get update
69-
sudo apt-get install -y wget python3-pip git ninja-build graphviz lcov
70-
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
71-
echo "${DOXYGEN_MD5SUM} doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" | md5sum -c
72-
if [ $? -ne 0 ]; then
73-
echo "Failed to verify doxygen tarball"
74-
exit 1
75-
fi
76-
sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt
77-
echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
78-
echo "${HOME}/.local/bin" >> $GITHUB_PATH
73+
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
74+
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
75+
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
76+
77+
- name: Apply container owner mismatch workaround
78+
run: |
79+
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
80+
# match the container user UID because of the way GitHub
81+
# Actions runner is implemented. Remove this workaround when
82+
# GitHub comes up with a fundamental fix for this problem.
83+
git config --global --add safe.directory ${GITHUB_WORKSPACE}
84+
85+
- name: Clone cached Zephyr repository
86+
continue-on-error: true
87+
run: |
88+
git clone --shared /repo-cache/zephyrproject/zephyr .
89+
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
7990
8091
- name: checkout
8192
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -107,18 +118,12 @@ jobs:
107118
cache: pip
108119
cache-dependency-path: doc/requirements.txt
109120

110-
- name: Setup Zephyr project
111-
uses: zephyrproject-rtos/action-zephyr-setup@c125c5ebeeadbd727fa740b407f862734af1e52a # v1.0.9
112-
with:
113-
app-path: zephyr
114-
toolchains: 'all'
115-
116-
- name: install-pip
121+
- name: Install Python packages required for documentation build
117122
working-directory: zephyr
118123
run: |
119-
pip install -r doc/requirements.txt --require-hashes
124+
pip install -r scripts/requirements-actions.txt -r doc/requirements.txt --require-hashes
120125
121-
- name: build-docs
126+
- name: Build HTML documentation
122127
shell: bash
123128
working-directory: zephyr
124129
run: |
@@ -128,11 +133,11 @@ jobs:
128133
DOC_TAG="development"
129134
fi
130135
131-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
132-
DOC_TARGET="html-fast"
133-
else
136+
# if [[ "${{ github.event_name }}" == "pull_request" ]]; then
137+
# DOC_TARGET="html-fast"
138+
# else
134139
DOC_TARGET="html"
135-
fi
140+
# fi
136141
137142
DOC_TAG=${DOC_TAG} \
138143
SPHINXOPTS="-j ${JOB_COUNT} -W --keep-going -T" \
@@ -145,27 +150,27 @@ jobs:
145150
lcov --remove doc-coverage.info \*/deprecated > new.info
146151
genhtml --no-function-coverage --no-branch-coverage new.info -o coverage-report
147152
148-
- name: compress-docs
153+
- name: Compress documentation build artifacts
149154
working-directory: zephyr
150155
run: |
151156
tar --use-compress-program="xz -T0" -cf html-output.tar.xz --exclude html/_sources --exclude html/doxygen/xml --directory=doc/_build html
152157
tar --use-compress-program="xz -T0" -cf api-output.tar.xz --directory=doc/_build html/doxygen/html
153158
tar --use-compress-program="xz -T0" -cf api-coverage.tar.xz coverage-report
154159
155-
- name: upload-build
160+
- name: Upload HTML output
156161
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
157162
with:
158163
name: html-output
159164
path: zephyr/html-output.tar.xz
160165

161-
- name: upload-api-coverage
166+
- name: Upload Doxygen coverage artifacts
162167
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
163168
with:
164169
name: api-coverage
165170
path: zephyr/api-coverage.tar.xz
166171

167172

168-
- name: process-pr
173+
- name: Summarize PR documentation URLs
169174
if: github.event_name == 'pull_request'
170175
run: |
171176
REPO_NAME="${{ github.event.repository.name }}"
@@ -179,7 +184,7 @@ jobs:
179184
echo "API Documentation will be available shortly at: ${API_DOC_URL}" >> $GITHUB_STEP_SUMMARY
180185
echo "API Coverage Report will be available shortly at: ${API_COVERAGE_URL}" >> $GITHUB_STEP_SUMMARY
181186
182-
- name: upload-pr-number
187+
- name: Upload PR number
183188
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
184189
if: github.event_name == 'pull_request'
185190
with:

0 commit comments

Comments
 (0)