-
Notifications
You must be signed in to change notification settings - Fork 46
50 lines (48 loc) · 1.42 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: benchmark
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- master
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22'
check-latest: true
- uses: actions/checkout@v4
- name: go mod tidy
run: |
mkdir bench
cd bench
awk '{if($0 ~ "// go test -v -cpu=4 "){a=1;b=1};if($0 ~ "```" && b=1){b=0};if (a&&b) {print}}' ../README.md | tee bench_test.go
go mod init bench
go mod tidy
go mod edit -replace github.com/phuslu/log=../
- name: Throughput benchmarks
working-directory: ./bench
run: |
go test -v -cpu=4 -run=none -bench=. -benchtime=5s -benchmem
sloghanders:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.22'
check-latest: true
- uses: actions/checkout@v4
- name: go mod tidy
run: |
mkdir bench
cd bench
awk '{if($0 ~ "// go test -v -cpu=1 "){a=1;b=1};if($0 ~ "```" && b=1){b=0};if (a&&b) {print}}' ../README.md | tee bench_test.go
go mod init bench
go mod tidy
go mod edit -replace github.com/phuslu/log=../
- name: Throughput benchmarks
working-directory: ./bench
run: |
go test -v -cpu=1 -run=none -bench=. -benchtime=5s -benchmem