Skip to content

Commit

Permalink
ci: adding suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Dec 27, 2023
1 parent e9a01f7 commit e7d1409
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions .github/workflows/cachegrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,18 @@ jobs:
- name: Run Valgrind
run: |
cargo b -r -p revm-test --bin snailtracer
valgrind --tool=cachegrind target/release/snailtracer
# Extract relevant information from cachegrind.out file
cg_annotate cachegrind.out.* > cachegrind_results.txt
# valgrind --tool=cachegrind target/release/snailtracer
valgrind --tool=cachegrind target/release/snailtracer 2>&1 | tee cachegrind_results.txt
- name: Valgrind results
id: valgrind_results
run: |
cat cachegrind_results.txt
contents=$(<cachegrind_results.txt)
printf "out=%s" "${contents//$'\n'/\\n}" >> "$GITHUB_OUTPUT"
- name: Setup cURL for filebin
run: |
sudo apt-get install -y curl
- name: Upload file to GitHub and get URL
id: upload-comment
run: |
UPLOAD_URL=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"Uploaded file: [temp_file.txt]($UPLOAD_URL)"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments" \
--upload-file cachegrind_results.txt | jq -r .url)
printf "file_url=%s" "${UPLOAD_URL}" >> "$GITHUB_OUTPUT"
contents=$(printf "%s" "$(head -c 64000 cachegrind_results.txt)")
# dump line by line into a file
printf "Valgrind Results:\n\n\`\`\`\n%s\n\`\`\`" "$contents" > results.md
- name: Comment on issue with file link
- name: Comment on PR
env:
GH_TOKEN: ${{ github.token }}
run: |
gh issue comment ${{ github.event.number }} -b "Uploaded file: [temp_file.txt](${{ steps.upload-comment.outputs.file_url }})"



gh pr comment ${{ github.event.pull_request.number }} --body-file results.md

0 comments on commit e7d1409

Please sign in to comment.