Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions:
env:
UV_FROZEN: true
UV_PYTHON: 3.13 # use the latest version of Python because it is faster
RUST_VERSION: "1.87.0"

jobs:
benchmarks:
Expand All @@ -30,9 +31,10 @@ jobs:

- name: Install rust.
id: rust-toolchain
uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
components: llvm-tools
toolchain: ${{ env.RUST_VERSION }}

- name: Cache rust.
uses: Swatinem/rust-cache@v2
Expand All @@ -42,7 +44,7 @@ jobs:
with:
manylinux: auto
args: --release --out pgo-wheel --interpreter ${{ env.UV_PYTHON }}
rust-toolchain: 1.76.0
rust-toolchain: ${{ env.RUST_VERSION }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
Expand All @@ -55,14 +57,14 @@ jobs:
uv run pytest . --benchmark-enable

- name: Prepare merged PGO data.
run: rustup run 1.76.0 bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata'
run: rustup run ${{ env.RUST_VERSION }} bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata'

- name: Build PGO-optimized wheel.
uses: PyO3/maturin-action@v1
with:
manylinux: auto
args: --release --out dist --interpreter ${{ env.UV_PYTHON }}
rust-toolchain: 1.76.0
rust-toolchain: ${{ env.RUST_VERSION }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
permissions:
contents: read

env:
RUST_VERSION: "1.87.0"

jobs:
build:
name: Build on ${{ matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
Expand Down Expand Up @@ -80,17 +83,18 @@ jobs:

- name: Install rust
id: rust-toolchain
uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
components: llvm-tools
toolchain: ${{ env.RUST_VERSION }}

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10 pypy3.11' }}
rust-toolchain: 1.76.0
rust-toolchain: ${{ env.RUST_VERSION }}
docker-options: -e CI

- name: List wheels.
Expand Down Expand Up @@ -138,9 +142,10 @@ jobs:

- name: Install rust.
id: rust-toolchain
uses: dtolnay/rust-toolchain@1.76.0
uses: dtolnay/rust-toolchain@master
with:
components: llvm-tools
toolchain: ${{ env.RUST_VERSION }}

- name: Set RUST_HOST.
shell: bash
Expand All @@ -151,7 +156,7 @@ jobs:
with:
manylinux: auto
args: --release --out pgo-wheel --interpreter ${{ matrix.interpreter }}
rust-toolchain: 1.76.0
rust-toolchain: ${{ env.RUST_VERSION }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
Expand All @@ -164,7 +169,7 @@ jobs:
uv run pytest . --benchmark-enable

# we can't use github.workspace here because of Windows with backslashes
rustup run 1.76.0 bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'
rustup run ${{ env.RUST_VERSION }} bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'

- name: Prepare merged PGO data.
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
Expand All @@ -174,7 +179,7 @@ jobs:
with:
manylinux: auto
args: --release --out dist --interpreter ${{ matrix.interpreter }}
rust-toolchain: 1.76.0
rust-toolchain: ${{ env.RUST_VERSION }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
Expand Down
Loading