Add comprehensive Doxygen configuration for documentation generation #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
| name: Documentation Build and Deploy | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-docs: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install matplotlib seaborn pandas | |
| - name: Install Doxygen | |
| run: | | |
| choco install doxygen.install --no-progress | |
| choco install graphviz --no-progress | |
| - name: Verify Doxygen installation | |
| run: | | |
| doxygen --version | |
| dot -V | |
| - name: Setup XMake | |
| uses: xmake-io/github-action-setup-xmake@v1 | |
| with: | |
| xmake-version: latest | |
| - name: Configure XMake | |
| run: | | |
| xmake config --with-benchmarks=true --with-testing=true | |
| - name: Build C++ library | |
| run: | | |
| xmake build | |
| - name: Run C++ tests | |
| run: | | |
| xmake test | |
| if (-not $?) { exit 1 } | |
| - name: Run Python tests | |
| run: | | |
| python -m pytest tests/ -v --tb=short | |
| if (-not $?) { exit 1 } | |
| - name: Build benchmarks | |
| run: | | |
| xmake build bench_geometry bench_quadtree | |
| - name: Run benchmarks | |
| run: | | |
| xmake run bench_geometry --benchmark_out=docs/benchmarks/geometry_results.json --benchmark_out_format=json | |
| xmake run bench_quadtree --benchmark_out=docs/benchmarks/spatial_results.json --benchmark_out_format=json | |
| continue-on-error: true | |
| - name: Create performance visualization | |
| run: | | |
| if (Test-Path "docs/benchmarks/geometry_results.json") { | |
| Write-Host "Benchmark results found - creating visualization placeholder" | |
| mkdir -p docs/images | |
| # Create a simple text file as placeholder | |
| "Benchmark results generated on $(Get-Date)" | Out-File -FilePath "docs/images/benchmark_results.txt" | |
| } else { | |
| Write-Host "No benchmark results found" | |
| } | |
| continue-on-error: true | |
| - name: Copy examples to documentation | |
| run: | | |
| if (Test-Path "examples") { | |
| Copy-Item -Path "examples/*.py" -Destination "docs/examples/" -Force | |
| Write-Host "Copied Python examples to documentation" | |
| } | |
| - name: Build documentation with Doxygen | |
| run: | | |
| mkdir -p docs/generated | |
| doxygen Doxyfile | |
| if (Test-Path "docs/generated/html/index.html") { | |
| Write-Host "Documentation built successfully" | |
| } else { | |
| Write-Host "Documentation build failed" | |
| exit 1 | |
| } | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| if: github.ref == 'refs/heads/main' | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| path: docs/generated/html | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| if: github.ref == 'refs/heads/main' | |
| # Separate job for documentation validation | |
| validate-docs: | |
| runs-on: ubuntu-latest | |
| needs: build-docs | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Validate documentation structure | |
| run: | | |
| echo "Validating documentation structure..." | |
| find docs/ -name "*.md" -type f | head -10 | |
| echo "Documentation validation completed" | |
| # Build status notification | |
| notify-status: | |
| runs-on: ubuntu-latest | |
| needs: [build-docs] | |
| if: always() | |
| steps: | |
| - name: Documentation Build Status | |
| run: | | |
| if [[ "${{ needs.build-docs.result }}" == "success" ]]; then | |
| echo "✅ Documentation build completed successfully" | |
| echo "📖 Documentation will be available at: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" | |
| else | |
| echo "❌ Documentation build failed" | |
| exit 1 | |
| fi |