Skip to content

Commit

Permalink
Fix comment v2
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueDoctor committed Aug 12, 2024
1 parent 059b586 commit 18ec536
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions .github/workflows/profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,21 @@ jobs:
run: |
cargo bench --bench compile_demo_art --features=iai -- --baseline master > benchmark_results.txt
- name: Parse benchmark results
id: parse_results
run: |
COMMENT="## Performance Benchmark Results\n\n"
while IFS= read -r line; do
if [[ $line == *"Comparison with"* ]]; then
COMMENT+="### $line\n"
elif [[ $line == *"Instructions:"* || $line == *"L1 Hits:"* || $line == *"Estimated Cycles:"* ]]; then
COMMENT+="$line\n"
fi
done < benchmark_results.txt
echo "comment<<EOF" >> $GITHUB_OUTPUT
echo -e "$COMMENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const benchmarkResults = fs.readFileSync('benchmark_results.txt', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.name,
issue_number: context.issue.number,
body: `## Performance Benchmark Results
${benchmarkResults}`
})
\`\`\`
${benchmarkResults}
\`\`\``
});

0 comments on commit 18ec536

Please sign in to comment.