Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Harden Python codegen formatting #333

Harden Python codegen formatting

Harden Python codegen formatting #333

Workflow file for this run

name: Documentation
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# Test that all documentation examples compile
test-docs:
name: Test Documentation Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
- name: Test documentation examples
run: |
# Test that all doctests pass
cargo test --doc --all-features
# Test that documentation compiles without warnings
cargo doc --no-deps --all-features --document-private-items
- name: Install mdBook and mdbook-keeper
run: |
# Pin to mdbook 0.4.x (0.5.x changed preprocessor JSON format,
# breaking mdbook-keeper compatibility)
if ! command -v mdbook &> /dev/null; then
cargo install mdbook --version "~0.4"
fi
if ! command -v mdbook-keeper &> /dev/null; then
cargo install mdbook-keeper --version "~0.5"
fi
- name: Test mdBook examples
run: |
cd docs
mdbook build
# Build and deploy documentation site
build-and-deploy:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
needs: test-docs
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ runner.os }}-cargo-deploy-${{ hashFiles('**/Cargo.lock') }}
- name: Install mdBook and mdbook-keeper
run: |
if ! command -v mdbook &> /dev/null; then
cargo install mdbook --version "~0.4"
fi
if ! command -v mdbook-keeper &> /dev/null; then
cargo install mdbook-keeper --version "~0.5"
fi
- name: Build mdBook documentation
run: |
cd docs
mdbook build
- name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4.32.0"
command: deploy
workingDirectory: docs