Skip to content

tests: net: lib: llmnr_responder: rename testcase.yaml to tests.yaml #20

tests: net: lib: llmnr_responder: rename testcase.yaml to tests.yaml

tests: net: lib: llmnr_responder: rename testcase.yaml to tests.yaml #20

Workflow file for this run

# Copyright (c) 2020 Linaro Limited.
# SPDX-License-Identifier: Apache-2.0
name: Documentation Build
on:
push:
branches:
- main
tags:
- v*
pull_request:
permissions:
contents: read
env:
DOXYGEN_VERSION: 1.15.0
DOXYGEN_SHA256SUM: 0ec2e5b2c3cd82b7106d19cb42d8466450730b8cb7a9e85af712be38bf4523a1
JOB_COUNT: 8
jobs:
doc-file-check:
name: Check for doc changes
runs-on: ubuntu-24.04
timeout-minutes: 15
outputs:
sphinx_check: ${{ steps.check-sphinx-files.outputs.any_modified }}
doxygen_check: ${{ steps.check-doxygen-files.outputs.any_modified }}
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check if any file pulled into the Sphinx documentation changed
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
id: check-sphinx-files
with:
files: |
doc/
boards/**/doc/
**.rst
**/Kconfig*
west.yml
scripts/dts/
.github/workflows/doc-build.yml
scripts/pylib/pytest-twister-harness/src/twister_harness/device/device_adapter.py
scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py
- name: Check if any file pulled into the Doxygen API documentation changed
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
id: check-doxygen-files
with:
files: |
doc/zephyr.doxyfile.in
doc/_doxygen/
include/
kernel/include/kernel_arch_interface.h
lib/libc/**
subsys/testsuite/ztest/include/**
doc-build-html:
name: "Documentation Build (HTML)"
needs: [doc-file-check]
if: >
needs.doc-file-check.outputs.sphinx_check == 'true' ||
needs.doc-file-check.outputs.doxygen_check == 'true' ||
github.event_name != 'pull_request'
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.29.2.20260422
options: '--entrypoint /bin/bash'
timeout-minutes: 60
concurrency:
group: doc-build-html-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Clone cached Zephyr repository
continue-on-error: true
run: |
git clone --shared /repo-cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Environment Setup
uses: ./.github/actions/zephyr-ci-env
with:
base-ref: ${{ github.base_ref }}
- name: Install Python packages required for documentation build
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
pip install -r doc/requirements.txt --require-hashes
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- name: Install and vendor copies of JS libs within within docs sources
run: |
npm install --prefix doc
for pkg in mermaid d3; do
mkdir -p doc/_static/js/${pkg}
cp -a doc/node_modules/${pkg}/dist/. doc/_static/js/${pkg}/
done
- name: Build HTML documentation
shell: bash
env:
SPHINX_CHANGED: ${{ needs.doc-file-check.outputs.sphinx_check }}
run: |
DOXYGEN_OUT_DIR="doc/_build/html/doxygen"
if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then
DOC_TAG="release"
else
DOC_TAG="development"
fi
if [[ "${{ github.event_name }}" == "pull_request" && "${SPHINX_CHANGED}" != "true" ]]; then
# Only API (Doxygen) input files changed: build the API docs alone and skip the much
# slower Sphinx build. The standalone doxygen target writes to _build/doxygen; move it to
# ${DOXYGEN_OUT_DIR}.
DOC_TAG=${DOC_TAG} make -C doc doxygen
mkdir -p "$(dirname "${DOXYGEN_OUT_DIR}")"
mv doc/_build/doxygen "${DOXYGEN_OUT_DIR}"
else
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
DOC_TARGET="html-fast"
else
DOC_TARGET="html"
fi
DOC_TAG=${DOC_TAG} \
SPHINXOPTS="-j ${JOB_COUNT} -W --keep-going -T" \
SPHINXOPTS_EXTRA="-q -t publish" \
make -C doc ${DOC_TARGET} NO_EXTERNAL_DEPS=1
fi
# API documentation coverage
python3 -m coverxygen --xml-dir "${DOXYGEN_OUT_DIR}/xml/" --src-dir include/ --output doc-coverage.info
# deprecated page causing issues
lcov --remove doc-coverage.info \*/deprecated > new.info
genhtml --no-function-coverage --no-branch-coverage new.info -o coverage-report
- name: Run accessibility check (pa11y)
if: false # temporarily disabled due to CI issues
run: |
apt-get update -qq && apt-get install -y --no-install-recommends \
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
libxkbcommon0 libxdamage1 libgbm1 libpango-1.0-0 \
libcairo2 libasound2t64
npm install -g pa11y-ci@4 pa11y-ci-reporter-html@7
npx puppeteer browsers install chrome
python3 -m http.server 8000 --directory doc/_build/html &
SERVER_PID=$!
sleep 1
cat <<EOF > .pa11y-ci.json
{
"defaults": {
"timeout": 240000,
"runners": [
"axe",
"htmlcs"
],
"concurrency": 2,
"chromeLaunchConfig": {
"args": [
"--disable-dev-shm-usage",
"--no-sandbox"
]
}
},
"urls": [
{
"url": "http://localhost:8000/index.html?mode=light",
"screenCapture": "./pa11y-ci-report/index.png"
},
{
"url": "http://localhost:8000/index.html?mode=dark",
"screenCapture": "./pa11y-ci-report/index-dark.png"
},
{
"url": "http://localhost:8000/boards/index.html?mode=light#name=devkit",
"screenCapture": "./pa11y-ci-report/boards.png"
},
{
"url": "http://localhost:8000/boards/index.html?mode=dark#name=devkit",
"screenCapture": "./pa11y-ci-report/boards-dark.png"
},
{
"url": "http://localhost:8000/samples/index.html?mode=light",
"screenCapture": "./pa11y-ci-report/samples.png"
},
{
"url": "http://localhost:8000/samples/index.html?mode=dark",
"screenCapture": "./pa11y-ci-report/samples-dark.png"
},
{
"url": "http://localhost:8000/develop/getting_started/index.html?mode=light",
"screenCapture": "./pa11y-ci-report/getting-started.png"
},
{
"url": "http://localhost:8000/develop/getting_started/index.html?mode=dark",
"screenCapture": "./pa11y-ci-report/getting-started-dark.png"
},
{
"url": "http://localhost:8000/contribute/documentation/guidelines.html?mode=light",
"screenCapture": "./pa11y-ci-report/guidelines.png"
},
{
"url": "http://localhost:8000/contribute/documentation/guidelines.html?mode=dark",
"screenCapture": "./pa11y-ci-report/guidelines-dark.png"
}
]
}
EOF
mkdir -p pa11y-ci-report
pa11y-ci -c .pa11y-ci.json -T 9999 --reporter=pa11y-ci-reporter-html
kill $SERVER_PID
- name: Compress documentation build artifacts
run: |
tar --use-compress-program="xz -T0" -cf html-output.tar.xz --exclude html/_sources --exclude html/doxygen/xml --directory=doc/_build html
tar --use-compress-program="xz -T0" -cf api-output.tar.xz --directory=doc/_build html/doxygen/html
tar --use-compress-program="xz -T0" -cf api-coverage.tar.xz coverage-report
# tar --use-compress-program="xz -T0" -cf accessibility-report.tar.xz pa11y-ci-report # temporarily disabled due to CI issues
- name: Upload accessibility report
if: false # temporarily disabled due to CI issues
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: accessibility-report
path: accessibility-report.tar.xz
- name: Upload HTML output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: html-output
path: html-output.tar.xz
- name: Upload Doxygen coverage artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: api-coverage
path: api-coverage.tar.xz
- name: Summarize PR documentation URLs
if: github.event_name == 'pull_request'
env:
SPHINX_CHANGED: ${{ needs.doc-file-check.outputs.sphinx_check }}
run: |
REPO_NAME="${{ github.event.repository.name }}"
PR_NUM="${{ github.event.pull_request.number }}"
DOC_URL="https://builds.zephyrproject.io/${REPO_NAME}/pr/${PR_NUM}/docs/"
API_DOC_URL="https://builds.zephyrproject.io/${REPO_NAME}/pr/${PR_NUM}/docs/doxygen/html/"
API_COVERAGE_URL="https://builds.zephyrproject.io/${REPO_NAME}/pr/${PR_NUM}/api-coverage/"
A11Y_REPORT_URL="https://builds.zephyrproject.io/${REPO_NAME}/pr/${PR_NUM}/accessibility-report/"
echo "${PR_NUM}" > pr_num
echo "Build results will be available shortly at the following URLs:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${SPHINX_CHANGED}" = "true" ]; then
echo "- Documentation: ${DOC_URL}" >> $GITHUB_STEP_SUMMARY
else
echo "- Documentation: not rebuilt (only API/Doxygen inputs changed in this PR)" >> $GITHUB_STEP_SUMMARY
fi
echo "- API Documentation: ${API_DOC_URL}" >> $GITHUB_STEP_SUMMARY
echo "- API Coverage Report: ${API_COVERAGE_URL}" >> $GITHUB_STEP_SUMMARY
echo "- Accessibility Report: ${A11Y_REPORT_URL}" >> $GITHUB_STEP_SUMMARY
- name: Upload PR number
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: github.event_name == 'pull_request'
with:
name: pr_num
path: pr_num
doc-build-pdf:
name: "Documentation Build (PDF)"
needs: [doc-file-check]
if: |
github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 120
concurrency:
group: doc-build-pdf-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
path: zephyr
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: doc/requirements.txt
- name: install-pkgs
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends graphviz librsvg2-bin \
texlive-latex-base texlive-latex-extra latexmk \
texlive-fonts-recommended texlive-fonts-extra texlive-xetex \
imagemagick fonts-noto xindy
wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
echo "${DOXYGEN_SHA256SUM} doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" | sha256sum -c
if [ $? -ne 0 ]; then
echo "Failed to verify doxygen tarball"
exit 1
fi
sudo tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz -C /opt
echo "/opt/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@5ec39f5cba83346d83a836dfed1524270c660e28 # v1.0.14
with:
app-path: zephyr
toolchains: 'arm-zephyr-eabi'
enable-ccache: false
- name: install-pip-pkgs
working-directory: zephyr
run: |
pip install -r doc/requirements.txt --require-hashes
- name: build-docs
shell: bash
working-directory: zephyr
continue-on-error: true
run: |
if [[ "$GITHUB_REF" =~ "refs/tags/v" ]]; then
DOC_TAG="release"
else
DOC_TAG="development"
fi
DOC_TAG=${DOC_TAG} \
SPHINXOPTS="-q -j ${JOB_COUNT}" \
LATEXMKOPTS="-quiet -halt-on-error" \
make -C doc pdf
- name: upload-build
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pdf-output
if-no-files-found: ignore
path: |
zephyr/doc/_build/latex/zephyr.pdf
zephyr/doc/_build/latex/zephyr.log
doc-build-status-check:
if: always()
name: "Documentation Build Status"
needs:
- doc-build-pdf
- doc-file-check
- doc-build-html
uses: ./.github/workflows/ready-to-merge.yml
with:
needs_context: ${{ toJson(needs) }}