Skip to content

Commit 383f497

Browse files
committed
move windows x86_64 builds to PGO
1 parent 9003451 commit 383f497

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,13 @@ jobs:
360360
container: messense/manylinux_2_24-cross:s390x
361361
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
362362
exclude:
363-
# Optimized PGO builds for manylinux follow a different matrix, maybe in future
364-
# maturin-action can support this automatically
363+
# Optimized PGO builds for x86_64 manylinux and windows follow a different matrix,
364+
# maybe in future maturin-action can support this automatically
365365
- os: ubuntu
366366
target: x86_64
367367
manylinux: auto
368+
- os: windows
369+
target: x86_64
368370
# Windows on arm64 only supports Python 3.11+
369371
- os: windows
370372
target: aarch64
@@ -410,11 +412,17 @@ jobs:
410412
strategy:
411413
fail-fast: false
412414
matrix:
413-
os: [ubuntu]
414-
platform: [linux]
415+
os: [ubuntu, windows]
415416
target: [x86_64]
416417
manylinux: [auto]
417-
interpreter: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9"]
418+
interpreter: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy3.7", "pypy3.8", "pypy3.9"]
419+
include:
420+
- os: ubuntu
421+
platform: linux
422+
- os: windows
423+
ls: dir
424+
- interpreter: 3.12-dev
425+
maturin-interpreter: "3.12"
418426

419427
runs-on: ${{ matrix.os }}-latest
420428
steps:
@@ -445,18 +453,25 @@ jobs:
445453
args: >
446454
--release
447455
--out pgo-wheel
448-
--interpreter ${{ matrix.interpreter }}
456+
--interpreter ${{ matrix.maturin-interpreter || matrix.interpreter }}
449457
-- -Cprofile-generate=${{ github.workspace }}/profdata
450458
rust-toolchain: stable
451459
docker-options: -e CI
452460

461+
- name: detect rust host
462+
run: echo RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) >> "$GITHUB_ENV"
463+
shell: bash
464+
453465
- name: generate pgo data
454466
run: |
455467
pip install -U pip
456468
pip install -r tests/requirements.txt
457469
pip install pydantic-core --no-index --no-deps --find-links pgo-wheel --force-reinstall
458470
pytest tests/benchmarks
459-
rustup run stable 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'
471+
rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'
472+
473+
- name: merge pgo data
474+
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
460475

461476
- name: build pgo-optimized wheel
462477
uses: PyO3/maturin-action@v1
@@ -466,7 +481,7 @@ jobs:
466481
args: >
467482
--release
468483
--out dist
469-
--interpreter ${{ matrix.interpreter }}
484+
--interpreter ${{ matrix.maturin-interpreter || matrix.interpreter }}
470485
-- -Cprofile-use=${{ github.workspace }}/merged.profdata
471486
rust-toolchain: stable
472487
docker-options: -e CI

0 commit comments

Comments
 (0)