mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-12-08 14:03:51 +00:00
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I1432980533dee11b64a53d2ad2f2094d6a6a6964
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
name: hotpath-profile
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
profile:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR HEAD
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
|
|
- name: Run timing profiling on HEAD
|
|
env:
|
|
HOTPATH_JSON: "true"
|
|
run: |
|
|
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_timing.json
|
|
|
|
- name: Run allocation profiling on HEAD
|
|
env:
|
|
HOTPATH_JSON: "true"
|
|
run: |
|
|
cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_alloc.json
|
|
|
|
- name: Checkout base branch
|
|
run: |
|
|
git checkout ${{ github.event.pull_request.base.sha }}
|
|
|
|
- name: Run timing profiling on base
|
|
env:
|
|
HOTPATH_JSON: "true"
|
|
run: |
|
|
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_timing.json || echo '{}' > /tmp/base_timing.json
|
|
|
|
- name: Run allocation profiling on base
|
|
env:
|
|
HOTPATH_JSON: "true"
|
|
run: |
|
|
cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_alloc.json || echo '{}' > /tmp/base_alloc.json
|
|
|
|
- name: Save PR number
|
|
run: |
|
|
echo '${{ github.event.pull_request.number }}' > /tmp/pr_number.txt
|
|
|
|
- name: Upload profiling results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: hotpath-results
|
|
path: |
|
|
/tmp/head_timing.json
|
|
/tmp/head_alloc.json
|
|
/tmp/base_timing.json
|
|
/tmp/base_alloc.json
|
|
/tmp/pr_number.txt
|
|
retention-days: 1
|