Skip to content

Feat/pecos deps

Feat/pecos deps #130

name: Documentation Tests & Build
on:
push:
branches: [ main, master, development, dev ]
paths:
- 'docs/**'
pull_request:
branches: [ main, master, development, dev ]
paths:
- 'docs/**'
workflow_dispatch:
env:
RUSTFLAGS: -C debuginfo=0
RUST_BACKTRACE: 1
PYTHONUTF8: 1
jobs:
docs-ci:
name: Test and build documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Set up Rust
run: rustup show
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: python/pecos-rslib
- name: Install LLVM 14.0.6 using pecos-llvm
run: |
echo "Installing LLVM using pecos..."
cargo run -p pecos --features cli --release -- llvm install
echo "Setting LLVM environment variables..."
export PECOS_LLVM=$(cargo run -p pecos --features cli --release -- llvm find 2>/dev/null)
export LLVM_SYS_140_PREFIX="$PECOS_LLVM"
echo "PECOS_LLVM=$PECOS_LLVM" >> $GITHUB_ENV
echo "LLVM_SYS_140_PREFIX=$LLVM_SYS_140_PREFIX" >> $GITHUB_ENV
echo "Verifying LLVM installation..."
cargo run -p pecos --features cli --release -- llvm check
- name: Generate lockfile and install dependencies
run: |
uv lock --project .
uv sync --project .
- name: Install pecos-rslib with maturin
run: |
cd python/pecos-rslib
uv run maturin develop --uv
- name: Install quantum-pecos from local source
run: |
cd python/quantum-pecos
uv pip install -e .
- name: Test working documentation examples
run: |
uv run python scripts/docs/test_working_examples.py
# TODO: Re-enable documentation code examples testing once documentation is updated
# Currently skipped due to outdated code examples with missing imports and API changes
- name: Test all code examples
if: false # Temporarily disabled - see TODO above
run: |
uv run python scripts/docs/test_code_examples.py
- name: Build documentation
if: success()
run: |
uv run mkdocs build