Skip to content

Commit e40c472

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

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/ci.yml

Lines changed: 19 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,15 @@ 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
418424

419425
runs-on: ${{ matrix.os }}-latest
420426
steps:
@@ -445,18 +451,24 @@ jobs:
445451
args: >
446452
--release
447453
--out pgo-wheel
448-
--interpreter ${{ matrix.interpreter }}
449454
-- -Cprofile-generate=${{ github.workspace }}/profdata
450455
rust-toolchain: stable
451456
docker-options: -e CI
452457

458+
- name: detect rust host
459+
run: echo RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) >> "$GITHUB_ENV"
460+
shell: bash
461+
453462
- name: generate pgo data
454463
run: |
455464
pip install -U pip
456465
pip install -r tests/requirements.txt
457466
pip install pydantic-core --no-index --no-deps --find-links pgo-wheel --force-reinstall
458467
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'
468+
rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"'
469+
470+
- name: merge pgo data
471+
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
460472

461473
- name: build pgo-optimized wheel
462474
uses: PyO3/maturin-action@v1
@@ -466,7 +478,6 @@ jobs:
466478
args: >
467479
--release
468480
--out dist
469-
--interpreter ${{ matrix.interpreter }}
470481
-- -Cprofile-use=${{ github.workspace }}/merged.profdata
471482
rust-toolchain: stable
472483
docker-options: -e CI

0 commit comments

Comments
 (0)