docs: comprehensive documentation restructure and optimization #14
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Install linters | |
| run: pip install ruff | |
| - name: Ruff lint | |
| run: ruff check python/ tests/ benchmarks/ | |
| - name: Ruff format check | |
| run: ruff format --check python/ tests/ benchmarks/ | |
| test-cpu: | |
| name: CPU Tests | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| pip install -U pip | |
| pip install pytest hypothesis | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Verify Python syntax | |
| run: python -m compileall python tests benchmarks | |
| - name: Run CPU-safe tests | |
| run: | | |
| pytest tests/ -v -m "not cuda" --tb=short || code=$? | |
| if [ "${code:-0}" -eq 5 ]; then | |
| echo "No CPU-safe tests collected (exit code 5), treating as success" | |
| exit 0 | |
| fi | |
| exit ${code:-0} | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Validate YAML | |
| run: | | |
| pip install pyyaml | |
| python -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml')); print('ci.yml: OK')" | |
| python -c "import yaml; yaml.safe_load(open('.github/workflows/pages.yml')); print('pages.yml: OK')" | |
| - name: Check Markdown links | |
| run: | | |
| echo "Checking for broken internal links in documentation..." | |
| find . -name "*.md" -not -path "./.git/*" -exec grep -l "](./" {} \; | head -20 | |
| echo "Link check complete" |