Repository navigation
ci(deps): bump actions/setup-python from 5 to 6 #223
Workflow file for this run
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: PR Documentation Preview | |
| # Build documentation previews for pull requests | |
| # Uploads as artifacts for manual review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - 'docs/**' | |
| - 'src/**' | |
| - '*.md' | |
| - 'pyproject.toml' | |
| - '.github/workflows/docs-*.yml' | |
| - '.agent-os/product/**' | |
| - '.agent-os/standards/**' | |
| - 'examples/**' | |
| jobs: | |
| validate-api: | |
| name: Validate API Surface | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| # MANDATORY: AI Assistant Validation Protocol | |
| - name: π Validate Current API Surface | |
| run: | | |
| echo "AI Assistant Validation Protocol: Checking current API exports..." | |
| # Verify core files exist | |
| if [ ! -f "src/honeyhive/__init__.py" ]; then | |
| echo "β src/honeyhive/__init__.py not found" | |
| exit 1 | |
| fi | |
| # Check exports in __all__ (correct way for this codebase) | |
| if ! grep -q '"HoneyHive"' src/honeyhive/__init__.py; then | |
| echo "β HoneyHive not found in __all__ exports" | |
| exit 1 | |
| fi | |
| if ! grep -q '"HoneyHiveTracer"' src/honeyhive/__init__.py; then | |
| echo "β HoneyHiveTracer not found in __all__ exports" | |
| exit 1 | |
| fi | |
| echo "β API validation passed" | |
| build-preview: | |
| name: Build Documentation Preview | |
| runs-on: ubuntu-latest | |
| needs: validate-api | |
| permissions: | |
| pull-requests: write | |
| contents: read | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Create virtual environment (python-sdk) | |
| run: | | |
| python -m venv python-sdk | |
| source python-sdk/bin/activate | |
| echo "python-sdk/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: | | |
| source python-sdk/bin/activate | |
| python -m pip install --upgrade pip | |
| # Install package | |
| pip install -e . | |
| # Install documentation dependencies | |
| pip install sphinx>=7.0.0 sphinx-rtd-theme>=1.3.0 | |
| pip install sphinx-autodoc-typehints myst-parser sphinx-copybutton sphinx-design | |
| pip install sphinxcontrib-mermaid sphinx-tabs | |
| - name: Test imports | |
| run: | | |
| source python-sdk/bin/activate | |
| # Verify the API we're documenting actually works | |
| python -c " | |
| from honeyhive import HoneyHive, HoneyHiveTracer | |
| print('β Import test passed') | |
| " | |
| - name: Build documentation | |
| run: | | |
| source python-sdk/bin/activate | |
| cd docs | |
| # Clean and build | |
| make clean | |
| make html | |
| # Prepare for web deployment | |
| touch _build/html/.nojekyll | |
| # Validate output | |
| if [ ! -f "_build/html/index.html" ]; then | |
| echo "β Documentation build failed" | |
| exit 1 | |
| fi | |
| echo "β Documentation preview built successfully" | |
| - name: Upload documentation artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-preview-pr-${{ github.event.pull_request.number }} | |
| path: docs/_build/html/ | |
| retention-days: 7 | |
| - name: Comment PR with preview info | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const prNumber = context.issue.number; | |
| const artifactUrl = `${context.serverUrl}/${context.repo.owner}/` + | |
| `${context.repo.repo}/actions/runs/${context.runId}`; | |
| const body = `## π Documentation Preview Built | |
| β **Documentation preview is ready!** | |
| ### π¦ Download Preview | |
| [Download documentation artifact](${artifactUrl}) | |
| ### π How to Review | |
| 1. Download the artifact from the link above | |
| 2. Extract the files | |
| 3. Open \`index.html\` in your browser | |
| ### β Validation Status | |
| - API validation: β Passed | |
| - Build process: β Successful | |
| - Import tests: β All imports working | |
| --- | |
| *Preview generated for PR #${prNumber}*`; | |
| github.rest.issues.createComment({ | |
| issue_number: prNumber, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: body | |
| }); |