Skip to content

Commit fccc2a9

Browse files
committed
chore: run benchmark in GitHub workflows
1 parent 1b71250 commit fccc2a9

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Benchmark cmd/app
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
benchmark:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 5
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version: "1.25"
23+
24+
- name: Download dependencies
25+
run: go mod download
26+
27+
- name: Run benchmarks
28+
run: |
29+
go test -bench=. -benchmem -benchtime=10s -count=5 ./cmd/app | tee benchmark_result.txt
30+
31+
- name: Upload benchmark results
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: benchmark-results-cmd-app
35+
path: benchmark_result.txt
36+
retention-days: 7

.github/workflows/build_cmd_app.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
build-and-deploy:
8+
build:
99
runs-on: ubuntu-latest
10+
timeout-minutes: 5
1011

1112
steps:
1213
- uses: actions/checkout@v5

.github/workflows/test_cmd_app.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
test:
99
runs-on: ubuntu-latest
10+
timeout-minutes: 5
1011

1112
steps:
1213
- uses: actions/checkout@v5

0 commit comments

Comments
 (0)