Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/cpp-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: C++ Check

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
workflow_dispatch:

permissions:
contents: read

jobs:
linux-build-test:
name: Linux build and tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Docker image
run: |
docker build \
--platform linux/amd64 \
--build-arg QT_ARCH=linux_gcc_64 \
-f scripts/docker/Dockerfile.build \
-t cfdesktop-build \
.

- name: Configure, build, and test
run: |
docker run --rm \
--platform linux/amd64 \
-e QT_QPA_PLATFORM=offscreen \
-v "$PWD:/project" \
-w /project \
cfdesktop-build \
bash -lc "bash scripts/build_helpers/linux_develop_build.sh ci -c build_ci_config.ini && bash scripts/build_helpers/linux_run_tests.sh ci -c build_ci_config.ini"

docs-build:
name: VitePress docs build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build docs
run: npm run docs:build
112 changes: 37 additions & 75 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,56 @@
# 工作流名称
name: 自动部署 MkDocs
name: Deploy VitePress

# 触发条件:推送到 main 分支
on:
push:
branches:
- main

# 允许手动触发
workflow_dispatch:

# 设置权限
permissions:
contents: write # 允许推送到 gh-pages 分支
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
build:
runs-on: ubuntu-latest

steps:
# 1. 检出代码
- name: 检出仓库
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取完整历史,显示文章修改时间

# 2. 设置 Python
- name: 设置 Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
# cache: 'pip' # 缓存依赖,加速构建

# 3. 安装依赖
- name: 安装依赖
run: |
pip install mkdocs-material
pip install mkdocs-awesome-pages-plugin
pip install mkdocs-git-revision-date-localized-plugin

# 4. 安装 Doxygen
- name: 安装 Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen

# 5. 安装 doxybook2
- name: 安装 doxybook2
run: |
# 下载最新版本的 doxybook2
DOXYBOOK2_VERSION="1.5.0"
wget https://github.com/matusnovak/doxybook2/releases/download/v${DOXYBOOK2_VERSION}/doxybook2-linux-amd64-v${DOXYBOOK2_VERSION}.zip
unzip doxybook2-linux-amd64-v${DOXYBOOK2_VERSION}.zip
sudo mv bin/doxybook2 /usr/local/bin/
sudo chmod +x /usr/local/bin/doxybook2
doxybook2 --version
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

# 6. 生成 API 文档(Doxygen → Markdown)
- name: 生成 API 文档
run: |
doxygen Doxyfile
rm -rf document/api
mkdir -p document/api
doxybook2 --input ./xml \
--output ./document/api \
--config doxybook.json
- name: Setup Pages
uses: actions/configure-pages@v5

# 6.5. 为自动生成的 API 文档配置导航
- name: 配置 API 导航
run: |
cat > document/api/.pages <<'EOF'
title: API 自动文档
icon: material/file-document
nav:
- 命名空间: Namespaces
- 类: Classes
- 文件: Files
EOF
- name: Install dependencies
run: npm ci

# 6.6. 修复 doxybook2 生成的相对链接路径
- name: 修复 API 文档链接
run: python3 scripts/document/fix_doxybook_links.py
- name: Build docs
run: npm run docs:build

# 7. 构建网站
- name: 构建网站
run: mkdocs build --clean

# 8. 自动部署到 gh-pages 分支(这一步会自动触发 GitHub Pages)
- name: 部署到 GitHub Pages
uses: peaceiris/actions-gh-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub 自动提供的 token
publish_dir: ./site # MkDocs 构建输出目录
path: document/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
36 changes: 36 additions & 0 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docs Check

on:
pull_request:
branches:
- develop
types:
- opened
- synchronize
- reopened
- labeled

permissions:
contents: read

jobs:
vitepress:
name: VitePress build
if: contains(github.event.pull_request.labels.*.name, 'build-doc')
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build docs
run: npm run docs:build
70 changes: 39 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
# ignores
.cache
.claude

# aqtinstall log
aqtinstall.log
# privates
BLUEPRINT.md

# native builds
out/

# Documents summons
xml/
site/
document/api/

# .vscode
.vscode

# third_party dependencies (downloaded during configuration)
third_party/*/
!third_party/.gitkeep

__pycache__/

# Python virtual environment
.venv/

# Docker build logs
scripts/docker/logger/
# ignores
.cache
.claude
CLAUDE.md
MEMORY.md

# aqtinstall log
aqtinstall.log
# privates
BLUEPRINT.md

# native builds
out/

# Documents summons
xml/
site/
document/api/

# .vscode
.vscode

# third_party dependencies (downloaded during configuration)
third_party/*/
!third_party/.gitkeep

__pycache__/

# Python virtual environment
.venv/

# Docker build logs
scripts/docker/logger/

# Node/VitePress
node_modules/
document/.vitepress/cache/
document/.vitepress/dist/
document/.vitepress/.temp
73 changes: 73 additions & 0 deletions document/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { defineConfig } from "vitepress";

export default defineConfig({
title: "CFDesktop",
description: "A Qt-based Material Design 3 desktop framework for embedded devices.",
base: "/CFDesktop/",
cleanUrls: true,
lastUpdated: true,
ignoreDeadLinks: true,
srcExclude: ["api/**"],
markdown: {
html: false
},
themeConfig: {
nav: [
{ text: "Start Here", link: "/" },
{ text: "Development", link: "/development/" },
{ text: "Architecture", link: "/design_stage/system_architecture_overview" },
{ text: "Desktop Roadmap", link: "/todo/desktop/" },
{ text: "HandBook", link: "/HandBook/" }
],
sidebar: [
{
text: "Start Here",
items: [
{ text: "Overview", link: "/" },
{ text: "Current TODO", link: "/todo/" }
]
},
{
text: "Development",
items: [
{ text: "Guide", link: "/development/" },
{ text: "Prerequisites", link: "/development/01_prerequisites" },
{ text: "Quick Start", link: "/development/02_quick_start" },
{ text: "Build System", link: "/development/03_build_system" },
{ text: "CI", link: "/ci/" }
]
},
{
text: "Architecture",
items: [
{ text: "System Overview", link: "/design_stage/system_architecture_overview" },
{ text: "Display Backend", link: "/design_stage/multi_display_backend_architecture" },
{ text: "Desktop", link: "/desktop/" }
]
},
{
text: "Roadmap",
items: [
{ text: "Desktop Overview", link: "/todo/desktop/" },
{ text: "Milestones", link: "/todo/desktop/milestone_00_overview" },
{ text: "Done", link: "/todo/done/" }
]
},
{
text: "HandBook",
items: [
{ text: "HandBook", link: "/HandBook/" },
{ text: "Base", link: "/HandBook/base/" },
{ text: "UI", link: "/HandBook/ui/" },
{ text: "Desktop", link: "/HandBook/desktop/" }
]
}
],
socialLinks: [
{ icon: "github", link: "https://github.com/Awesome-Embedded-Learning-Studio/CFDesktop" }
],
search: {
provider: "local"
}
}
});
Loading
Loading