all repos

clerk @ e12aa47

missing tooling for ledger/hledger

clerk/.github/workflows/benchmarks.yml (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
ci: disable vetting for tests, 1 month ago
1
name: benchmarks
2
3
on:
4
  push:
5
    branches: [master]
6
  pull_request:
7
  workflow_dispatch:
8
9
concurrency:
10
  group: benchmarks-${{ github.ref }}
11
  cancel-in-progress: true
12
13
permissions:
14
  contents: read
15
16
jobs:
17
  bench:
18
    runs-on: ubuntu-latest
19
    timeout-minutes: 30
20
    steps:
21
      - uses: actions/checkout@v5
22
      - uses: actions/setup-go@v6
23
        with:
24
          go-version-file: go.mod
25
26
      - name: Install benchstat
27
        run: |
28
          go install golang.org/x/perf/cmd/benchstat@latest
29
          echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
30
31
      - name: Checkout base
32
        if: github.event_name == 'pull_request'
33
        uses: actions/checkout@v5
34
        with:
35
          ref: ${{ github.event.pull_request.base.sha }}
36
          path: __base
37
38
      - name: Run base benchmarks
39
        if: github.event_name == 'pull_request'
40
        working-directory: __base
41
        run: go test -vet=off -bench . -benchmem -run '^$' -count=6 -benchtime=100ms ./... > ../bench-base.txt 2>&1
42
43
      - name: Run benchmarks
44
        run: go test -vet=off -bench . -benchmem -run '^$' -count=6 -benchtime=100ms ./... > bench.txt 2>&1
45
46
      - name: Print benchmark numbers
47
        run: benchstat bench.txt
48
49
      - name: Print comparison
50
        if: github.event_name == 'pull_request'
51
        run: benchstat bench-base.txt bench.txt
52
53
      - name: Check for regressions
54
        if: github.event_name == 'pull_request'
55
        run: |
56
          benchstat -format csv bench-base.txt bench.txt 2>/dev/null | \
57
            python3 .github/scripts/check-bench-regression.py