Skip to content

Commit

Permalink
updated workflow for pgo
Browse files Browse the repository at this point in the history
  • Loading branch information
omerbenamram committed Apr 3, 2024
1 parent f0ae699 commit 0748608
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ jobs:
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
echo "release version: $RELEASE_VERSION"
- name: Build PGO Binary (Linux)
if: matrix.build == 'linux'
run: |
./build_pgo.sh
env:
HOME: ${{ github.workspace }}

- name: Build release binary
if: matrix.build == 'linux' || matrix.build == 'macos' || matrix.build == 'windows'
if: matrix.build == 'macos' || matrix.build == 'windows'
uses: actions-rs/cargo@v1
with:
command: build
Expand Down Expand Up @@ -185,3 +192,4 @@ jobs:
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET_NAME }}
asset_content_type: application/octet-stream

4 changes: 2 additions & 2 deletions build_pgo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rm -rf /tmp/pgo-data

PATH=$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/$TARGET/bin:$PATH
RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" \
cargo build --release --target $TARGET
cargo build --release --target $TARGET --features fast-alloc

echo "Running instrumented binary"
for i in $(find samples -name "*.evtx"); do
Expand All @@ -25,4 +25,4 @@ llvm-profdata merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data

echo "Building binary with profile data"
RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" \
cargo build --release --target $TARGET
cargo build --release --target $TARGET --features fast-alloc

0 comments on commit 0748608

Please sign in to comment.