Skip to content

feat: e2e test for examples (#119) #111

feat: e2e test for examples (#119)

feat: e2e test for examples (#119) #111

Workflow file for this run

name: Documentation Build
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
generate-demos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y tree ffmpeg
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Install litestar-vite package
run: uv pip install -e .
- name: Install VHS
run: |
# Install VHS via go (more reliable than charm install script)
go install github.com/charmbracelet/vhs@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Install ttyd
run: |
sudo apt-get install -y ttyd || {
# Fallback: install from GitHub releases
curl -fsSL -o /tmp/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64
chmod +x /tmp/ttyd
sudo mv /tmp/ttyd /usr/local/bin/ttyd
}
- name: Create output directory
run: mkdir -p docs/_static/demos
- name: Generate Demo GIFs
run: |
export PATH="$HOME/go/bin:$PATH"
# VHS needs to run from the project root where uv.lock exists
for tape in docs/_tapes/*.tape; do
echo "Processing $tape..."
vhs "$tape" || echo "Warning: $tape failed"
done
env:
# Disable Chrome sandbox for headless rendering
VHS_NO_SANDBOX: "true"
- name: List generated files
run: ls -la docs/_static/demos/ || echo "No demos generated"
- name: Upload demos artifact
uses: actions/upload-artifact@v5
with:
name: demo-gifs
path: docs/_static/demos/
if-no-files-found: warn
build:
needs: generate-demos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download demo artifacts
uses: actions/download-artifact@v6
with:
name: demo-gifs
path: docs/_static/demos/
continue-on-error: true
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Build documentation
run: uv run python tools/build_docs.py docs-build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs-build
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4