Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
run against master OR just run but don't compare results
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari committed Nov 23, 2023
1 parent bd19a91 commit ad1c5f4
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,29 @@ jobs:
set -o pipefail
make bench | tee ${{ github.sha }}_bench_output.txt
- name: Get Main branch SHA
- name: Get Master branch SHA
id: get-master-branch-sha
run: |
SHA=$(git rev-parse origin/master)
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Get benchmark JSON from main branch
- name: Get benchmark JSON from Master branch
id: cache
uses: actions/cache/restore@v3
with:
path: ./cache/benchmark-data.json
key: ${{ steps.get-master-branch-sha.outputs.sha }}-${{ runner.os }}-go-benchmark
fail-on-cache-miss: true

- name: Compare benchmarks
- name: Compare benchmarks with master
uses: benchmark-action/github-action-benchmark@v1
if: success()
if: steps.cache.outputs.cache-hit == 'true'
with:
alert-threshold: "200%"
# 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 benchmarks in main are (to compare)
# Where the benchmarks in master are (to compare)
external-data-json-path: ./cache/benchmark-data.json
# Do not save the data
save-data-file: false
Expand All @@ -97,3 +97,16 @@ jobs:
# Enable Job Summary for PRs
summary-always: true

- name: Run benchmarks but don't compare to master branch
uses: benchmark-action/github-action-benchmark@v1
if: steps.cache.outputs.cache-hit != 'true'
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
# Write benchmarks to this file, do not publish to GitHub Pages
save-data-file: false
external-data-json-path: ./cache/benchmark-data.json
# Enable Job Summary for PRs
summary-always: true

0 comments on commit ad1c5f4

Please sign in to comment.