Skip to content

Commit

Permalink
Merge pull request #2 from mazrean/dev/fix-benchmark
Browse files Browse the repository at this point in the history
ベンチマーク用CI修正
  • Loading branch information
mazrean authored Jan 13, 2024
2 parents dd227b1 + 7e4fac8 commit 431fa97
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: mkdir -p ./profile
- run: |
- name: Run benchmark
run: |
mkdir -p ./profile
{
echo "stdout<<EOF"
go test -benchmem -bench . -cpuprofile ./profile/cpu.out -memprofile ./profile/mem.out
Expand All @@ -28,7 +29,8 @@ jobs:
with:
name: profile
path: profile
- run: |
- name: Comment
run: |
cat << EOF > ./body.txt
## Benchmark Result
Expand All @@ -38,13 +40,17 @@ jobs:
<details>
<summary>pprof command</summary>
\`\`\`sh
unzip <(gh api /repos/${{ github.repository }}/actions/artifacts/${{ steps.artifact.outputs.artifact-id }}/zip)
gh api /repos/${{ github.repository }}/actions/artifacts/${{ steps.artifact.outputs.artifact-id }}/zip > /tmp/profile.zip
unzip /tmp/profile.zip -d profile
rm -rf /tmp/profile.zip
go tool pprof -http :6060 profile/cpu.out
\`\`\`
</details>
EOF
gh pr comment ${{ github.event.pull_request.number }} --edit-last -F ./body.txt --repo ${{ github.repository }}
gh pr comment ${{ github.event.pull_request.number }} --edit-last -F ./body.txt --repo ${{ github.repository }} ||
gh pr comment ${{ github.event.pull_request.number }} -F ./body.txt --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 431fa97

Please sign in to comment.