Skip to content

perf: remove redundant allocations and copies from the request and response hot paths #851

perf: remove redundant allocations and copies from the request and response hot paths

perf: remove redundant allocations and copies from the request and response hot paths #851

Workflow file for this run

name: Build docs
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: deploy
cancel-in-progress: false
jobs:
build-rust:
name: Build rustdoc
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Setup Rust
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- name: Configure cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- name: Clean docs folder
run: cargo clean --doc
- name: Build docs
run: RUSTFLAGS='--cfg reqwest_unstable' cargo doc --no-deps --manifest-path impit/Cargo.toml
- name: Remove lock file
run: rm target/doc/.lock
- name: Copy redirect
run: cp impit/docs/index.html target/doc/index.html
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: target/doc/
name: rustdoc
build-node:
name: Build TypeDoc documentation (Node.JS bindings)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Setup Rust
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- name: Configure cache
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
- name: Use Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
- name: Install pnpm and dependencies
uses: apify/actions/pnpm-install@v1.4.1
with:
working-directory: impit-node
- name: Build docs
run: cd impit-node && pnpm run docs
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: impit-node/docs/
name: typedoc
build-python:
name: Build Sphinx docs (Python bindings)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Use Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: 3.x
- name: Set up uv package manager
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Disable automatic `uv` builds
run: sed -i '/^\[tool\.uv\]$/a package = false' pyproject.toml
working-directory: impit-python
- name: Install dependencies
working-directory: impit-python
run: |
uv venv
source .venv/bin/activate
uv sync --all-groups --active --frozen
# comment out cookies module import
sed -i 's/from .cookies/#from .cookies/' ./python/impit/impit.pyi
sed -i 's/from .cookies/#from .cookies/' ./python/impit/__init__.py
sed -i 's/__version__/#__version__/' ./python/impit/__init__.py
# copy empty impit.py to avoid Sphinx errors
cp ./docs/stub.py ./python/impit/impit.py
- name: Build docs
working-directory: impit-python/docs
run: |
source ../.venv/bin/activate
uv run make html
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
path: impit-python/docs/_build/html
name: sphinx-doc
deploy:
name: Deploy
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build-rust, build-node, build-python]
steps:
- name: Download typedoc artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: typedoc
path: docs/js/
- name: Download Sphinx doc artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: sphinx-doc
path: docs/python/
- name: Setup pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- name: Upload docs to github pages
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5