-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #429 from hatoo/pgo-ci
release pgo binary
- Loading branch information
Showing
2 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Publish PGO | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
publish: | ||
name: Publish for ${{ matrix.target }} PGO | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
artifact_name: oha | ||
release_name: oha-linux-amd64-pgo | ||
target: x86_64-unknown-linux-musl | ||
additional_args: "--features vsock" | ||
- os: windows-latest | ||
artifact_name: oha.exe | ||
release_name: oha-windows-amd64-pgo.exe | ||
target: x86_64-pc-windows-msvc | ||
additional_args: "" | ||
- os: macos-latest | ||
artifact_name: oha | ||
release_name: oha-macos-amd64-pgo | ||
target: x86_64-apple-darwin | ||
additional_args: "" | ||
- os: macos-14 | ||
artifact_name: oha | ||
release_name: oha-macos-arm64-pgo | ||
target: aarch64-apple-darwin | ||
additional_args: "" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install musl-tools on Linux | ||
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools | ||
if: contains(matrix.target, 'musl') | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: ${{ matrix.target }} | ||
components: llvm-tools-preview | ||
- run: cargo install cargo-pgo | ||
- uses: taiki-e/install-action@just | ||
- run: just pgo '--target ${{ matrix.target }} ${{ matrix.additional_args }}' | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v1-release | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }} | ||
asset_name: ${{ matrix.release_name }} | ||
tag: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
pgo: | ||
[unix] | ||
pgo addtional-args="": | ||
#!/bin/bash | ||
trap "kill 0" EXIT | ||
# Disable trap in CI | ||
# `just` returns weired exit code if we use trap | ||
if [ -z $CI]; then trap "kill 0" EXIT; fi | ||
cargo run --release --manifest-path pgo/server/Cargo.toml & | ||
# Should be more than 1m | ||
cargo pgo run -- --profile pgo -- -z 3m -c 900 --no-tui http://localhost:8888 | ||
cargo pgo optimize build -- --profile pgo | ||
cargo pgo run -- --profile pgo {{addtional-args}} -- -z 3m -c 900 --no-tui http://localhost:8888 | ||
cargo pgo optimize build -- --profile pgo {{addtional-args}} | ||
|
||
set windows-powershell := true | ||
|
||
[windows] | ||
pgo addtional-args="": | ||
try { \ | ||
$proc = Start-Process -NoNewWindow -PassThru cargo -ArgumentList 'run','--release','--manifest-path','pgo/server/Cargo.toml'; \ | ||
cargo pgo run -- --profile pgo {{addtional-args}} -- -z 3m -c 900 --no-tui http://localhost:8888; \ | ||
cargo pgo optimize build -- --profile pgo {{addtional-args}}; \ | ||
} finally { Stop-Process -Id $proc.Id } |