diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c62883d..53a3e65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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