Skip to content

Commit 7701809

Browse files
committed
test: Add benchmark GH action
1 parent 9f21ff2 commit 7701809

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/bench.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Benchmarks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- bgins/feat-add-matching-sorts
10+
11+
permissions:
12+
deployments: write
13+
contents: write
14+
15+
jobs:
16+
run-solver-benchmarks:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Install golang
23+
uses: actions/setup-go@v5
24+
25+
- name: Run benchmarks
26+
run: ./stack benchmarks-solver | tee assets/benchmark-output.txt
27+
28+
- name: Download previous benchmark data
29+
uses: actions/cache@v4
30+
with:
31+
path: ./cache
32+
key: ${{ runner.os }}-benchmark
33+
34+
- name: Store benchmark results
35+
if: github.event_name == 'pull_request'
36+
uses: benchmark-action/github-action-benchmark@v1
37+
with:
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
tool: 'go'
40+
output-file-path: assets/benchmark-output.txt
41+
external-data-json-path: ./cache/benchmark-data.json
42+
comment-on-alert: true
43+
summary-always: true
44+
auto-push: false
45+
46+
# - name: Publish benchmark page
47+
# if: github.event_name != 'pull_request'
48+
# run: git push 'https://Lilypad-Tech:${{ secrets.GITHUB_TOKEN }}@github.com/Lilypad-Tech/lilypad.git' gh-pages:gh-pages
49+
50+
- name: Publish benchmark results
51+
if: github.event_name != 'pull_request'
52+
uses: benchmark-action/github-action-benchmark@v1
53+
with:
54+
github-token: ${{ secrets.GITHUB_TOKEN }}
55+
tool: 'go'
56+
output-file-path: assets/benchmark-output.txt
57+
auto-push: true

0 commit comments

Comments
 (0)