chore(deps): bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #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: benchdiff | |
on: | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
incoming: | |
if: github.event.label.name == 'benchdiff' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Benchmark | |
run: | | |
go test -run ^$ -bench . ./... -count 5 | tee -a bench.txt | |
- name: Upload Benchmark | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bench-incoming | |
path: bench.txt | |
current: | |
if: github.event.label.name == 'benchdiff' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Benchmark | |
run: | | |
go test -run ^$ -bench . ./... -count 5 | tee -a bench.txt | |
- name: Upload Benchmark | |
uses: actions/upload-artifact@v3 | |
with: | |
name: bench-current | |
path: bench.txt | |
benchstat: | |
if: github.event.label.name == 'benchdiff' | |
needs: [incoming, current] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Install benchstat | |
run: go install golang.org/x/perf/cmd/benchstat@latest | |
- name: Download Incoming | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: bench-incoming | |
path: bench-incoming | |
- name: Download Current | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: bench-current | |
path: bench-current | |
- name: Benchstat Results | |
run: benchstat bench-current/bench.txt bench-incoming/bench.txt | tee -a benchstat.txt | |
- name: Upload benchstat results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: benchstat | |
path: benchstat.txt | |
- name: Print bench result | |
run: | | |
curl -X POST \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ | |
-d '{"body":"```\n'"$(awk '{printf "%s\\n", $0}' ./benchstat.txt)"'```"}' | |
- name: Remove Label | |
uses: actions-ecosystem/action-remove-labels@v1 | |
with: | |
labels: benchdiff |