Skip to content

Commit

Permalink
Update CI build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Dec 12, 2024
1 parent 727d80b commit a39138f
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
jobs:
wheels:
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -29,7 +28,7 @@ jobs:
interpreter: pypy3.9 pypy3.10
- os: macos
target: aarch64
interpreter: 3.9 pypy3.9 pypy3.10
interpreter: pypy3.9 pypy3.10
- os: ubuntu
platform: linux
target: aarch64
Expand All @@ -48,14 +47,8 @@ jobs:
exclude:
- os: windows
target: aarch64
# PGO builds
# - os: ubuntu
# target: x86_64
# manylinux: auto
# - os: macos
# target: x86_64
# - os: windows
# target: x86_64

runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Set jemalloc for aarch64 Linux
Expand All @@ -71,23 +64,26 @@ jobs:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
docker-options: -e CI
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

wheels-pgo:
name: pgo-wheel ${{ matrix.os }} (${{ matrix.interpreter}})
name: pgo-wheel ${{ matrix.platform || matrix.os }} (${{ matrix.interpreter}})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
manylinux: [auto]
interpreter: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: windows

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -99,9 +95,6 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools
- 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
- name: Build initial wheel
uses: PyO3/maturin-action@v1
with:
Expand All @@ -110,13 +103,17 @@ jobs:
command: build
args: --release --out pgo_wheel --interpreter ${{ matrix.interpreter }}
manylinux: ${{ matrix.manylinux || 'auto' }}
docker-options: -e CI
env:
RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
- 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
- name: Generate PGO data
shell: bash
run: |
pip install granian --no-index --no-deps --find-links pgo_wheel
pip install .[test]
pip install granian --no-index --no-deps --find-links pgo_wheel --force-reinstall
PGO_RUN=y pytest tests
- name: merge PGO data
run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
Expand All @@ -128,6 +125,7 @@ jobs:
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
Expand Down

0 comments on commit a39138f

Please sign in to comment.