ensure benchmarks are compared if the CPUs are the same
This commit is contained in:
8
.github/workflows/master.yaml
vendored
8
.github/workflows/master.yaml
vendored
@@ -37,10 +37,14 @@ jobs:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: true
|
||||
|
||||
- name: Get CPU information
|
||||
uses: kenchan0130/actions-system-info@master
|
||||
id: system-info
|
||||
|
||||
- name: Save benchmark JSON to cache
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: ./cache/benchmark-data.json
|
||||
# Save with commit hash to avoid "cache already exists"
|
||||
# Save with OS to prevent comparing against results from different CPUs
|
||||
key: ${{ github.sha }}-${{ runner.os }}-go-benchmark
|
||||
# Save with OS & CPU info to prevent comparing against results from different CPUs
|
||||
key: ${{ github.sha }}-${{ runner.os }}-${{ steps.system-info.outputs.cpu-model }}-go-benchmark
|
||||
|
6
.github/workflows/pull_request.yaml
vendored
6
.github/workflows/pull_request.yaml
vendored
@@ -56,6 +56,10 @@ jobs:
|
||||
set -o pipefail
|
||||
make bench | tee ${{ github.sha }}_bench_output.txt
|
||||
|
||||
- name: Get CPU information
|
||||
uses: kenchan0130/actions-system-info@master
|
||||
id: system-info
|
||||
|
||||
- name: Get Master branch SHA
|
||||
id: get-master-branch-sha
|
||||
run: |
|
||||
@@ -67,7 +71,7 @@ jobs:
|
||||
id: cache
|
||||
with:
|
||||
path: ./cache/benchmark-data.json
|
||||
key: ${{ steps.get-master-branch-sha.outputs.sha }}-${{ runner.os }}-go-benchmark
|
||||
key: ${{ steps.get-master-branch-sha.outputs.sha }}-${{ runner.os }}-${{ steps.system-info.outputs.cpu-model }}-go-benchmark
|
||||
|
||||
- name: Compare benchmarks with master
|
||||
uses: benchmark-action/github-action-benchmark@v1
|
||||
|
Reference in New Issue
Block a user