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
24 changes: 23 additions & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- pyproject.toml
# And when we change this workflow itself...
- .github/workflows/build-binaries.yml
- scripts/build_ty_pgo.py

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -227,7 +228,7 @@ jobs:

linux:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: depot-ubuntu-24.04-4
runs-on: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'depot-ubuntu-24.04-8' || 'depot-ubuntu-24.04-4' }}
strategy:
matrix:
target:
Expand All @@ -242,13 +243,34 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: "Install uv for PGO training"
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: "Install LLVM profiling tools"
id: pgo-toolchain
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
working-directory: ruff
run: |
rustup component add llvm-tools-preview
echo "toolchain=$(rustc --version | cut -d ' ' -f2)" >> "$GITHUB_OUTPUT"
- name: "Train PGO ty"
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
run: |
python scripts/build_ty_pgo.py \
--target "${{ matrix.target }}" \
--target-dir "${{ github.workspace }}/ruff/target/ty-pgo" \
--train-only

PROFILE_HOT_COUNT="$(cat "${{ github.workspace }}/ruff/target/ty-pgo/ty.profile-hot-count")"
echo "RUSTFLAGS=${RUSTFLAGS:+${RUSTFLAGS} }-Cprofile-use=${{ github.workspace }}/ruff/target/ty-pgo/ty.profdata -Cllvm-args=--profile-summary-hot-count=$PROFILE_HOT_COUNT" >> "$GITHUB_ENV"
- name: "Prep README.md"
run: python scripts/transform_readme.py
- name: "Build wheels"
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
maturin-version: v1.14.1
target: ${{ matrix.target }}
rust-toolchain: ${{ steps.pgo-toolchain.outputs.toolchain }}
manylinux: 2_17
args: --release --locked --out dist --compatibility pypi
- name: "Test wheel"
Expand Down
Loading