hvm32 compat (#139) #1
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: {} # temporarily disabled | |
concurrency: | |
group: bench-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
bench: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
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 fetch origin main | |
cd .. | |
git clone https://github.com/higherorderco/hvm-compare-perf | |
cd hvm-compare-perf | |
NO_COLOR=1 cargo run bench \ | |
--core ../hvm-64 \ | |
-r main -r ${{ github.sha }} \ | |
-m intr-singl -m intr-multi \ | |
> ../hvm-64/table | |
- name: write comment | |
run: | | |
echo 'Perf run for [`'`git rev-parse --short ${{ github.sha }}`'`](https://github.com/higherorderco/hvm-64/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: ${{ secrets.PAT }} | |
- name: hide old comment | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
COMMENT_ID=$( | |
gh api graphql -F pr=${{ github.event.number }} -f query=' | |
query($pr: Int!) { | |
organization(login: "higherorderco") { | |
repository(name: "hvm-64") { | |
pullRequest(number: $pr) { | |
comments(last: 100) { | |
nodes { id author { login } } | |
} | |
} | |
} | |
} | |
} | |
' \ | |
| jq -r ' | |
[ | |
.data.organization.repository.pullRequest.comments.nodes | .[] | |
| select(.author.login == "HigherOrderBot") | |
| .id | |
] | .[-2] | |
' | |
) | |
if [ $COMMENT_ID != null ] | |
then | |
gh api graphql -F id=$COMMENT_ID -f query=' | |
mutation($id: ID!) { | |
minimizeComment(input: { | |
subjectId: $id, | |
classifier: OUTDATED, | |
}) { minimizedComment { ...on Comment { id } } } | |
} | |
' | |
fi | |
- name: delete on cancel | |
if: ${{ cancelled() }} | |
run: gh workflow run delete-cancelled.yml -f run_id=${{ github.run_id }} | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} |