Harden Python codegen formatting #333
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: 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 |