add bench workflow #11
Workflow file for this run
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
name: Bench | |
on: | |
pull_request: | |
concurrency: | |
group: bench-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
bench: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
pull-requests: write | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dsherret/rust-toolchain-file@v1 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-check-${{ hashFiles('**/Cargo.lock') }} | |
- name: compare perf | |
run: | | |
git clone https://github.com/higherorderco/hvm-compare-perf | |
cd hvm-compare-perf | |
NO_COLOR=1 cargo run bench -r main -r ${{ github.sha }} -f programs/c2.hvmc > ../table | |
- name: write comment | |
run: | | |
echo 'Perf run for [`'`git rev-parse --short ${{ github.sha }}`'`](https://github.com/higherorderco/hvm-core/commit/${{ github.sha }}):' >> comment | |
echo '```' >> comment | |
cat table >> comment | |
echo '```' >> comment | |
- name: post comment | |
run: gh pr comment ${{ github.event.number }} -F comment | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: delete on cancel | |
if: ${{ cancelled() }} | |
run: gh api "repos/higherorderco/hmv-core/actions/runs/${{ github.run_id }}" -X DELETE | |
env: | |
GH_TOKEN: ${{ github.token }} |