Skip to content

Commit 8b5c600

Browse files
author
shijiashuai
committed
ci: 收敛主线CI至CPU安全的格式与文档检查
移除无法在GitHub Hosted Runner上有效执行的CUDA构建矩阵和pre-commit检查,将CI聚焦于稳定且有价值的质量门。 具体包括: - 移除build-cuda和pre-commit作业 - 更新format-check作业以检查C/C++/CUDA格式 - 更新docs作业的依赖项 - 使ci-success作业同时依赖format-check和docs的结果 - 简化触发分支和工作流命名 调整依据在于,原GPU作业在托管Runner上无实际验收意义,而代码格式与文档构建是当前最稳定、最核心的主线质量保障。
1 parent 483ca1f commit 8b5c600

File tree

2 files changed

+24
-78
lines changed

2 files changed

+24
-78
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
# HPC-AI-Optimization-Lab CI Pipeline
21
name: CI
32

43
on:
54
push:
6-
branches: [main, develop]
5+
branches: [main, master]
76
pull_request:
8-
branches: [main]
7+
branches: [main, master]
8+
workflow_dispatch:
99

1010
permissions:
1111
contents: read
1212

1313
concurrency:
14-
group: ${{ github.workflow }}-${{ github.ref }}
14+
group: ci-${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

1717
jobs:
18-
# Code formatting check
1918
format-check:
2019
name: Format Check
2120
runs-on: ubuntu-latest
2221
steps:
2322
- uses: actions/checkout@v4
2423

25-
- name: Check C++ formatting
26-
uses: jidicula/clang-format-action@v4.11.0
24+
- name: Check C/C++/CUDA formatting
25+
uses: jidicula/clang-format-action@v4.13.0
2726
with:
2827
clang-format-version: '17'
2928
check-path: 'src'
@@ -41,52 +40,6 @@ jobs:
4140
ruff check python/
4241
ruff format --check python/
4342
44-
# Build and test with CUDA
45-
build-cuda:
46-
name: Build & Test (CUDA ${{ matrix.cuda }})
47-
if: false # Disabled: requires GPU runner not available on GitHub-hosted runners
48-
runs-on: ubuntu-latest
49-
container:
50-
image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu22.04
51-
strategy:
52-
fail-fast: false
53-
matrix:
54-
cuda: ['12.2.0', '12.4.1']
55-
include:
56-
- cuda: '12.4.1'
57-
primary: true
58-
59-
steps:
60-
- uses: actions/checkout@v4
61-
62-
- name: Install dependencies
63-
run: |
64-
apt-get update
65-
apt-get install -y \
66-
cmake \
67-
ninja-build \
68-
git \
69-
python3-dev \
70-
python3-pip \
71-
wget
72-
pip3 install pytest numpy
73-
74-
- name: Configure CMake
75-
run: |
76-
cmake -B build \
77-
-G Ninja \
78-
-DCMAKE_BUILD_TYPE=Release \
79-
-DCMAKE_CUDA_ARCHITECTURES=80
80-
81-
- name: Build
82-
run: cmake --build build --parallel
83-
84-
- name: Run tests
85-
run: |
86-
cd build
87-
ctest --output-on-failure --timeout 300
88-
89-
# Build documentation
9043
docs:
9144
name: Build Documentation
9245
runs-on: ubuntu-latest
@@ -104,9 +57,9 @@ jobs:
10457
python-version: '3.11'
10558
cache: pip
10659

107-
- name: Install Sphinx
60+
- name: Install doc dependencies
10861
run: |
109-
pip install sphinx sphinx-rtd-theme breathe
62+
pip install sphinx sphinx-rtd-theme breathe myst-parser sphinx-copybutton
11063
11164
- name: Build Doxygen docs
11265
run: |
@@ -124,36 +77,16 @@ jobs:
12477
echo "Sphinx config not found, skipping"
12578
fi
12679
127-
# Pre-commit hooks
128-
pre-commit:
129-
name: Pre-commit Checks
130-
runs-on: ubuntu-latest
131-
steps:
132-
- uses: actions/checkout@v4
133-
134-
- name: Set up Python
135-
uses: actions/setup-python@v5
136-
with:
137-
python-version: '3.11'
138-
cache: pip
139-
140-
- name: Run pre-commit
141-
uses: pre-commit/action@v3.0.0
142-
with:
143-
extra_args: --all-files --show-diff-on-failure
144-
continue-on-error: true
145-
146-
# Summary job
14780
ci-success:
14881
name: CI Success
149-
needs: [format-check]
15082
runs-on: ubuntu-latest
83+
needs: [format-check, docs]
15184
if: always()
15285
steps:
15386
- name: Check all jobs
15487
run: |
155-
if [[ "${{ needs.format-check.result }}" == "failure" ]]; then
156-
echo "One or more jobs failed"
88+
if [[ "${{ needs.format-check.result }}" != "success" || "${{ needs.docs.result }}" != "success" ]]; then
89+
echo "One or more required jobs failed"
15790
exit 1
15891
fi
15992
echo "All required jobs passed!"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Workflow CPU-safe CI 调整
2+
3+
日期:2026-03-13
4+
5+
## 变更内容
6+
7+
- 移除主线 CI 中无效的 CUDA 构建矩阵与 `continue-on-error` 掩盖逻辑,保留 `Format Check``Build Documentation``CI Success`
8+
-`CI Success` 同时依赖格式与文档构建结果,避免只看单个 job 造成误判
9+
- 保留 C++/Python 格式检查与 Sphinx/Doxygen 文档构建,维持 Hosted Runner 上可执行的验收范围
10+
11+
## 背景
12+
13+
该仓库原先的 GPU job 在 GitHub Hosted Runner 上没有真实验收意义,而文档与格式检查才是当前最稳定、最有价值的主线质量门。本次调整将 CI 收敛到这些 CPU-safe 检查。

0 commit comments

Comments
 (0)