test #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
bench-main: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 | |
with: | |
ref: main | |
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
- name: Run benchmark of main | |
run: | | |
set -o pipefail | |
make bench | tee main_bench_output.txt | |
- name: Store benchmark result of main | |
uses: benchmark-action/github-action-benchmark@70405016b032d44f409e4b1b451c40215cbe2393 # v1.18.0 | |
with: | |
# What benchmark tool the output.txt came from | |
tool: 'go' | |
# Where the output from the benchmark tool is stored | |
output-file-path: main_bench_output.txt | |
# Where the output from the benchmark will be stored | |
external-data-json-path: ./main_bench_output.json | |
save-data-file: true | |
fail-on-alert: false | |
bench-PR: | |
runs-on: ubuntu-latest | |
needs: [bench-main] | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2 | |
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |
with: | |
go-version-file: './go.mod' | |
cache-dependency-path: './go.sum' | |
check-latest: true | |
- name: Run benchmark of PR | |
run: | | |
set -o pipefail | |
make bench | tee ${{ github.sha }}_bench_output.txt | |
- name: Compare benchmark result | |
uses: benchmark-action/github-action-benchmark@70405016b032d44f409e4b1b451c40215cbe2393 # v1.18.0 | |
with: | |
# What benchmark tool the output.txt came from | |
tool: 'go' | |
# Where the output from the benchmark tool is stored | |
output-file-path: ${{ github.sha }}_bench_output.txt | |
# Where the previous data file is stored | |
external-data-json-path: ./main_bench_output.json | |
# Do not save the data | |
save-data-file: false | |
# Workflow will fail when an alert happens | |
fail-on-alert: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true | |
# Enable Job Summary for PRs | |
summary-always: true | |
comment-always: true |