Skip to content

Bump go.uber.org/mock from 0.4.0 to 0.5.0 #48

Bump go.uber.org/mock from 0.4.0 to 0.5.0

Bump go.uber.org/mock from 0.4.0 to 0.5.0 #48

Workflow file for this run

name: Benchmark
on:
pull_request:
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run benchmark
run: |
mkdir -p ./profile
{
echo "stdout<<EOF"
go test -short -benchmem -bench . -cpuprofile ./profile/cpu.out -memprofile ./profile/mem.out
echo "EOF"
} >> $GITHUB_OUTPUT
id: bench
- uses: actions/upload-artifact@v4
id: artifact
with:
name: profile
path: profile
- name: Comment
run: |
cat << EOF > ./body.txt
## Benchmark Result
\`\`\`text
${{ steps.bench.outputs.stdout }}
\`\`\`
<details>
<summary>pprof command</summary>
\`\`\`sh
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 }} -F ./body.txt --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}