chore: update GitHub Pages workflow and docs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # HPC-AI-Optimization-Lab CI Pipeline | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| # Code formatting check | ||
| format-check: | ||
| name: Format Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Check C++ formatting | ||
| uses: jidicula/clang-format-action@v4.11.0 | ||
| with: | ||
| clang-format-version: '17' | ||
| check-path: 'src' | ||
| fallback-style: 'Google' | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: pip | ||
| - name: Check Python formatting | ||
| run: | | ||
| pip install ruff | ||
| ruff check python/ | ||
| ruff format --check python/ | ||
| # Build and test with CUDA | ||
| build-cuda: | ||
| name: Build & Test (CUDA ${{ matrix.cuda }}) | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| cuda: ['12.2.0', '12.4.1'] | ||
| include: | ||
| - cuda: '12.4.1' | ||
| primary: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: | | ||
| apt-get update | ||
| apt-get install -y \ | ||
| cmake \ | ||
| ninja-build \ | ||
| git \ | ||
| python3-dev \ | ||
| python3-pip \ | ||
| wget | ||
| pip3 install pytest numpy | ||
| - name: Configure CMake | ||
| run: | | ||
| cmake -B build \ | ||
| -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_CUDA_ARCHITECTURES=80 | ||
| - name: Build | ||
| run: cmake --build build --parallel | ||
| - name: Run tests | ||
| run: | | ||
| cd build | ||
| ctest --output-on-failure --timeout 300 | ||
| # Build documentation | ||
| docs: | ||
| name: Build Documentation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install Doxygen | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y doxygen graphviz | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: pip | ||
| - name: Install Sphinx | ||
| run: | | ||
| pip install sphinx sphinx-rtd-theme breathe | ||
| - name: Build Doxygen docs | ||
| run: | | ||
| if [ -f docs/Doxyfile ]; then | ||
| cd docs && doxygen Doxyfile | ||
| else | ||
| echo "Doxyfile not found, skipping Doxygen" | ||
| fi | ||
| - name: Build Sphinx docs | ||
| run: | | ||
| if [ -f docs/python/conf.py ]; then | ||
| cd docs/python && sphinx-build -b html . _build/html | ||
| else | ||
| echo "Sphinx config not found, skipping" | ||
| fi | ||
| # Pre-commit hooks | ||
| pre-commit: | ||
| name: Pre-commit Checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: pip | ||
| - name: Run pre-commit | ||
| uses: pre-commit/action@v3.0.0 | ||
| with: | ||
| extra_args: --all-files --show-diff-on-failure | ||
| continue-on-error: true | ||
| # Summary job | ||
| ci-success: | ||
| name: CI Success | ||
| needs: [format-check, build-cuda] | ||
| runs-on: ubuntu-latest | ||
| if: always() | ||
| steps: | ||
| - name: Check all jobs | ||
| run: | | ||
| if [[ "${{ needs.format-check.result }}" == "failure" ]] || \ | ||
| [[ "${{ needs.build-cuda.result }}" == "failure" ]]; then | ||
| echo "One or more jobs failed" | ||
| exit 1 | ||
| fi | ||
| echo "All required jobs passed!" | ||