Skip to content

Commit 9c81a85

Browse files
authored
Specify Rust version using env variable; bump rust to 1.87.0 (#67)
1 parent 0f7dec9 commit 9c81a85

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/codspeed.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
env:
1414
UV_FROZEN: true
1515
UV_PYTHON: 3.13 # use the latest version of Python because it is faster
16+
RUST_VERSION: "1.87.0"
1617

1718
jobs:
1819
benchmarks:
@@ -30,9 +31,10 @@ jobs:
3031

3132
- name: Install rust.
3233
id: rust-toolchain
33-
uses: dtolnay/rust-toolchain@1.76.0
34+
uses: dtolnay/rust-toolchain@master
3435
with:
3536
components: llvm-tools
37+
toolchain: ${{ env.RUST_VERSION }}
3638

3739
- name: Cache rust.
3840
uses: Swatinem/rust-cache@v2
@@ -42,7 +44,7 @@ jobs:
4244
with:
4345
manylinux: auto
4446
args: --release --out pgo-wheel --interpreter ${{ env.UV_PYTHON }}
45-
rust-toolchain: 1.76.0
47+
rust-toolchain: ${{ env.RUST_VERSION }}
4648
docker-options: -e CI
4749
env:
4850
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
@@ -55,14 +57,14 @@ jobs:
5557
uv run pytest . --benchmark-enable
5658
5759
- name: Prepare merged PGO data.
58-
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'
60+
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'
5961

6062
- name: Build PGO-optimized wheel.
6163
uses: PyO3/maturin-action@v1
6264
with:
6365
manylinux: auto
6466
args: --release --out dist --interpreter ${{ env.UV_PYTHON }}
65-
rust-toolchain: 1.76.0
67+
rust-toolchain: ${{ env.RUST_VERSION }}
6668
docker-options: -e CI
6769
env:
6870
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
permissions:
1212
contents: read
1313

14+
env:
15+
RUST_VERSION: "1.87.0"
16+
1417
jobs:
1518
build:
1619
name: Build on ${{ matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
@@ -80,17 +83,18 @@ jobs:
8083

8184
- name: Install rust
8285
id: rust-toolchain
83-
uses: dtolnay/rust-toolchain@1.76.0
86+
uses: dtolnay/rust-toolchain@master
8487
with:
8588
components: llvm-tools
89+
toolchain: ${{ env.RUST_VERSION }}
8690

8791
- name: Build wheels
8892
uses: PyO3/maturin-action@v1
8993
with:
9094
target: ${{ matrix.target }}
9195
manylinux: ${{ matrix.manylinux || 'auto' }}
9296
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' }}
93-
rust-toolchain: 1.76.0
97+
rust-toolchain: ${{ env.RUST_VERSION }}
9498
docker-options: -e CI
9599

96100
- name: List wheels.
@@ -138,9 +142,10 @@ jobs:
138142

139143
- name: Install rust.
140144
id: rust-toolchain
141-
uses: dtolnay/rust-toolchain@1.76.0
145+
uses: dtolnay/rust-toolchain@master
142146
with:
143147
components: llvm-tools
148+
toolchain: ${{ env.RUST_VERSION }}
144149

145150
- name: Set RUST_HOST.
146151
shell: bash
@@ -151,7 +156,7 @@ jobs:
151156
with:
152157
manylinux: auto
153158
args: --release --out pgo-wheel --interpreter ${{ matrix.interpreter }}
154-
rust-toolchain: 1.76.0
159+
rust-toolchain: ${{ env.RUST_VERSION }}
155160
docker-options: -e CI
156161
env:
157162
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
@@ -164,7 +169,7 @@ jobs:
164169
uv run pytest . --benchmark-enable
165170
166171
# we can't use github.workspace here because of Windows with backslashes
167-
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"'
172+
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"'
168173
169174
- name: Prepare merged PGO data.
170175
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
@@ -174,7 +179,7 @@ jobs:
174179
with:
175180
manylinux: auto
176181
args: --release --out dist --interpreter ${{ matrix.interpreter }}
177-
rust-toolchain: 1.76.0
182+
rust-toolchain: ${{ env.RUST_VERSION }}
178183
docker-options: -e CI
179184
env:
180185
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"

0 commit comments

Comments
 (0)