1- # HPC-AI-Optimization-Lab CI Pipeline
21name : CI
32
43on :
54 push :
6- branches : [main, develop ]
5+ branches : [main, master ]
76 pull_request :
8- branches : [main]
7+ branches : [main, master]
8+ workflow_dispatch :
99
1010permissions :
1111 contents : read
1212
1313concurrency :
14- group : ${{ github.workflow }}-${{ github.ref }}
14+ group : ci- ${{ github.workflow }}-${{ github.ref }}
1515 cancel-in-progress : true
1616
1717jobs :
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'
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
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!"
0 commit comments