github.com/phuslu/log@v1.0.100/.github/workflows/benchmark.yml (about)

     1  name: benchmark
     2  
     3  on:
     4    schedule:
     5      - cron: '0 0 * * *'
     6    push:
     7      branches:
     8        - master
     9  
    10  jobs:
    11    benchmark:
    12      runs-on: ubuntu-latest
    13      steps:
    14        - uses: actions/setup-go@v4
    15          with:
    16            go-version: '1.22'
    17            check-latest: true
    18        - uses: actions/checkout@v4
    19        - name: go mod tidy
    20          run: |
    21            mkdir bench
    22            cd bench
    23            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
    24            go mod init bench
    25            go mod tidy
    26            go mod edit -replace github.com/phuslu/log=../
    27        - name: Throughput benchmarks
    28          working-directory: ./bench
    29          run: |
    30            go test -v -cpu=4 -run=none -bench=. -benchtime=5s -benchmem
    31    sloghanders:
    32      runs-on: ubuntu-latest
    33      steps:
    34        - uses: actions/setup-go@v4
    35          with:
    36            go-version: '1.22'
    37            check-latest: true
    38        - uses: actions/checkout@v4
    39        - name: go mod tidy
    40          run: |
    41            mkdir bench
    42            cd bench
    43            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
    44            go mod init bench
    45            go mod tidy
    46            go mod edit -replace github.com/phuslu/log=../
    47        - name: Throughput benchmarks
    48          working-directory: ./bench
    49          run: |
    50            go test -v -cpu=1 -run=none -bench=. -benchtime=5s -benchmem