Skip to content

Commit

Permalink
Test profile-arcs flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Dec 14, 2024
1 parent 7ac20de commit 0b3eeb0
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
manylinux: ${{ matrix.manylinux || 'auto' }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata -Cprofile-arcs"
- run: |
RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/$RUST_HOST/bin/llvm-profdata >> "$GITHUB_ENV"'
shell: bash
Expand All @@ -124,32 +124,27 @@ jobs:
# uv pip install -r .github/workflows/_pgo_deps.txt
# uv pip install granian --no-index --no-deps --find-links pgo_wheel --force-reinstall
# PGO_RUN=y LLVM_PROFILE_FILE=${{ github.workspace }}/profdata/%m_%p.profraw uv run --no-sync pytest tests
- name: Upload temp wheels

- name: Generate PGO data
shell: bash
run: |
pip install -r .github/workflows/_pgo_deps.txt
pip install granian --no-index --no-deps --find-links pgo_wheel --force-reinstall
PGO_RUN=y LLVM_PROFILE_FILE=${{ github.workspace }}/profdata/%m_%p.profraw pytest tests
- name: merge PGO data
run: ${{ env.LLVM_PROFDATA }} merge --failure-mode=all -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
- name: Build PGO wheel
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --out dist --interpreter ${{ matrix.interpreter }}
manylinux: ${{ matrix.manylinux || 'auto' }}
rust-toolchain: stable
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: pgo_wheel
path: pgo_wheel

# - name: Generate PGO data
# shell: bash
# run: |
# pip install -r .github/workflows/_pgo_deps.txt
# pip install granian --no-index --no-deps --find-links pgo_wheel --force-reinstall
# PGO_RUN=y LLVM_PROFILE_FILE=${{ github.workspace }}/profdata/%m_%p.profraw pytest tests
# - name: merge PGO data
# run: ${{ env.LLVM_PROFDATA }} merge --failure-mode=all -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
# - name: Build PGO wheel
# uses: PyO3/maturin-action@v1
# with:
# command: build
# args: --release --out dist --interpreter ${{ matrix.interpreter }}
# manylinux: ${{ matrix.manylinux || 'auto' }}
# rust-toolchain: stable
# docker-options: -e CI
# env:
# RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: dist
# path: dist
name: dist
path: dist

0 comments on commit 0b3eeb0

Please sign in to comment.