mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-10 04:37:55 +08:00
139 lines
4.9 KiB
YAML
139 lines
4.9 KiB
YAML
name: Build Docs
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- 'release/*'
|
|
paths:
|
|
- 'docs/**'
|
|
- 'src/**'
|
|
- 'examples/**'
|
|
- 'demos/**'
|
|
- 'configs/ci/docs/**'
|
|
- 'scripts/build_html_examples.sh'
|
|
- 'scripts/find_version.sh'
|
|
- 'lv_conf_template.h'
|
|
- 'lv_version.h'
|
|
- 'lvgl.h'
|
|
- '.github/workflows/compile_docs.yml'
|
|
|
|
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
|
|
# Ensure that only one commit will be running tests at a time on each PR
|
|
concurrency:
|
|
group: ${{ github.ref }}-${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
EM_VERSION: 2.0.4
|
|
EM_CACHE_FOLDER: 'emsdk-cache'
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Emscripten cache
|
|
id: cache-system-libraries
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ${{env.EM_CACHE_FOLDER}}
|
|
key: ${{env.EM_VERSION}}-${{ runner.os }}
|
|
|
|
- uses: mymindstorm/setup-emsdk@v14
|
|
with:
|
|
version: ${{env.EM_VERSION}}
|
|
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
|
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
- name: Build examples (with cache)
|
|
run: |
|
|
# Grab the current name in case the LVGL folder is not called lvgl
|
|
# as it could be the case if this is running from a fork
|
|
LVGL_FOLDER=$(pwd)
|
|
# Move to the parent folder to fetch emscripten port.
|
|
cd ..
|
|
./lvgl/scripts/build_html_examples.sh --symlink $LVGL_FOLDER
|
|
|
|
- name: Install Doxygen
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends doxygen
|
|
|
|
# Parses the source code and generates XML files from the documentation
|
|
- name: Generate Doxygen XML
|
|
run: |
|
|
cd docs
|
|
doxygen
|
|
|
|
# Tool used to convert Doxygen XML to .mdx API pages
|
|
- name: Install doxymark
|
|
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
run: |
|
|
npm install github:mutahharmkhan/doxymark
|
|
|
|
# Generate Documentation API pages
|
|
- name: Generate API pages
|
|
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
run: |
|
|
npx doxymark \
|
|
--input docs/doxygen/xml \
|
|
--output docs/api \
|
|
--index docs/api-index.json \
|
|
--preset fumadocs \
|
|
--auto-group \
|
|
--source-url https://github.com/lvgl/lvgl/tree/${{ github.sha }}/src
|
|
rm -rf docs/doxygen
|
|
|
|
- name: Install Example Documentation
|
|
run: npm i @lvgl/examples-generator
|
|
|
|
- name: Check Example Documentation
|
|
run: |
|
|
npx -p @lvgl/examples-generator lvgl-examples-check-about --src examples
|
|
npx -p @lvgl/examples-generator lvgl-examples-check-examples --src examples
|
|
|
|
- name: Generate Example Documentation
|
|
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
run: |
|
|
npx -p @lvgl/examples-generator lvgl-examples-gen \
|
|
--src examples \
|
|
--out docs/examples
|
|
|
|
- name: Retrieve version
|
|
id: version
|
|
run: |
|
|
echo "VERSION_NAME=$(scripts/find_version.sh)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Deploy to subfolder
|
|
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
uses: JamesIves/github-pages-deploy-action@v4.8.0
|
|
with:
|
|
token: ${{ secrets.LVGL_BOT_TOKEN }}
|
|
repository-name: lvgl/open-docs
|
|
branch: gh-pages # The branch the action should deploy to.
|
|
folder: docs # The folder the action should deploy.
|
|
target-folder: ${{ steps.version.outputs.VERSION_NAME }} # needs to match what is inside `docs/version_list.json`
|
|
git-config-name: lvgl-bot
|
|
git-config-email: lvgl-bot@users.noreply.github.com
|
|
commit: true
|
|
|
|
- name: Deploy to master
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
uses: JamesIves/github-pages-deploy-action@v4.8.0
|
|
with:
|
|
token: ${{ secrets.LVGL_BOT_TOKEN }}
|
|
repository-name: lvgl/open-docs
|
|
branch: gh-pages # The branch the action should deploy to.
|
|
folder: docs # The folder the action should deploy.
|
|
target-folder: latest # needs to match what is inside `docs/version_list.json`
|
|
git-config-name: lvgl-bot
|
|
git-config-email: lvgl-bot@users.noreply.github.com
|
|
commit: true
|