github.com/boomhut/fiber/v2@v2.0.0-20230603160335-b65c856e57d3/.github/workflows/benchmark.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - master
     5        - main
     6      paths:
     7        - '**'
     8        - '!docs/**'
     9        - '!**.md'
    10    pull_request:
    11      paths:
    12        - '**'
    13        - '!docs/**'
    14        - '!**.md'
    15  name: Benchmark
    16  jobs:
    17    Compare:
    18      runs-on: ubuntu-latest
    19      steps:
    20      - name: Install Go
    21        uses: actions/setup-go@v4
    22        with:
    23          go-version: 1.20.x
    24      - name: Fetch Repository
    25        uses: actions/checkout@v3
    26      - name: Run Benchmark
    27        run: set -o pipefail; go test ./... -benchmem -run=^$ -bench . | tee output.txt
    28      - name: Get Previous Benchmark Results
    29        uses: actions/cache@v3
    30        with:
    31          path: ./cache
    32          key: ${{ runner.os }}-benchmark
    33      - name: Save Benchmark Results
    34        uses: benchmark-action/github-action-benchmark@v1.16.2
    35        with:
    36          tool: 'go'
    37          output-file-path: output.txt
    38          github-token: ${{ secrets.BENCHMARK_TOKEN }}
    39          benchmark-data-dir-path: 'benchmarks'
    40          fail-on-alert: true
    41          comment-on-alert: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
    42          # Enable Job Summary for PRs - deactivated because of issues
    43          #summary-always: ${{ github.event_name != 'push' && github.event_name != 'workflow_dispatch' }}
    44          auto-push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
    45          save-data-file: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}