mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-09 20:27:41 +08:00
65ff21fa15
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
166 lines
5.5 KiB
YAML
166 lines
5.5 KiB
YAML
name: Build Docs
|
|
|
|
on:
|
|
workflow_dispatch: # allow manual triggering
|
|
pull_request:
|
|
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'
|
|
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@v16
|
|
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
|
|
run: |
|
|
npm install github:mutahharmkhan/doxymark
|
|
|
|
# Generate Documentation API pages
|
|
- name: Generate API pages
|
|
run: |
|
|
npx doxymark \
|
|
--input docs/doxygen/xml \
|
|
--output docs/src/api \
|
|
--index docs/src/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
|
|
run: |
|
|
npx -p @lvgl/examples-generator lvgl-examples-gen \
|
|
--src examples \
|
|
--out docs/src/examples
|
|
|
|
- name: Install mdx linter
|
|
run: npm i @lvgl/mdx-lint
|
|
|
|
- name: Run mdx linter
|
|
run: |
|
|
npx @lvgl/mdx-lint "docs/**/*.{md,mdx}" \
|
|
--fail-on-warning \
|
|
--reporter github
|
|
|
|
- name: Retrieve version
|
|
id: version
|
|
run: |
|
|
echo "VERSION_NAME=$(scripts/find_version.sh)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Deploy Specific Version
|
|
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }}
|
|
run: |
|
|
git clone https://lvgl-bot:${{ secrets.LVGL_BOT_TOKEN }}@github.com/lvgl/open-docs.git /tmp/open-docs
|
|
rm -rf /tmp/open-docs/${{ steps.version.outputs.VERSION_NAME }}
|
|
mkdir -p /tmp/open-docs/${{ steps.version.outputs.VERSION_NAME }}
|
|
cp -r docs/. /tmp/open-docs/${{ steps.version.outputs.VERSION_NAME }}/
|
|
cd /tmp/open-docs
|
|
git config user.name lvgl-bot
|
|
git config user.email lvgl-bot@users.noreply.github.com
|
|
git add .
|
|
git diff --cached --quiet || git commit -m "Deploy ${{ steps.version.outputs.VERSION_NAME }} ${{ github.sha }}"
|
|
git push
|
|
|
|
- name: Deploy Latest
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
run: |
|
|
git clone https://lvgl-bot:${{ secrets.LVGL_BOT_TOKEN }}@github.com/lvgl/open-docs.git /tmp/open-docs-latest
|
|
rm -rf /tmp/open-docs-latest/latest
|
|
rm -rf /tmp/open-docs-latest/${{ steps.version.outputs.VERSION_NAME }}
|
|
mkdir -p /tmp/open-docs-latest/latest
|
|
mkdir -p /tmp/open-docs-latest/${{ steps.version.outputs.VERSION_NAME }}
|
|
cp -r docs/. /tmp/open-docs-latest/latest/
|
|
cp -r docs/. /tmp/open-docs-latest/${{ steps.version.outputs.VERSION_NAME }}/
|
|
cd /tmp/open-docs-latest
|
|
git config user.name lvgl-bot
|
|
git config user.email lvgl-bot@users.noreply.github.com
|
|
git add .
|
|
git diff --cached --quiet || git commit -m "Deploy ${{ steps.version.outputs.VERSION_NAME }} and latest from commit ${{ github.sha }}"
|
|
git push
|
|
|