Skip to content

Commit 8b15a5d

Browse files
authored
Merge pull request #1222 from lukaszstolarczuk/bench-fixes
[CI][Bench] Add compare option to manual bench runs
2 parents 04d8f0f + 8492c62 commit 8b15a5d

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/benchmarks.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ on:
1313
type: string
1414
required: false
1515
default: ''
16+
bench_script_compare:
17+
description: Compare label, passed to script executing benchmark as '--compare <label>'
18+
type: choice
19+
required: false
20+
default: 'Baseline_PVC'
21+
options:
22+
- 'Baseline_PVC'
1623
runner:
1724
description: Runner
1825
type: choice
@@ -32,4 +39,5 @@ jobs:
3239
with:
3340
pr_no: ${{ inputs.pr_no }}
3441
bench_script_params: ${{ inputs.bench_script_params }}
42+
bench_script_compare: ${{ inputs.bench_script_compare }}
3543
runner: ${{ inputs.runner }}

.github/workflows/reusable_benchmarks.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
required: false
1515
type: string
1616
default: ''
17+
bench_script_compare:
18+
required: false
19+
type: string
20+
default: ''
1721
runner:
1822
required: false
1923
type: string
@@ -35,14 +39,24 @@ jobs:
3539
runs-on: ${{ inputs.runner }}
3640

3741
steps:
42+
- name: Establish bench params
43+
run: |
44+
params="${{ inputs.bench_script_params }}"
45+
if [ -n "${{ inputs.bench_script_compare }}" ]; then
46+
params="$params --compare '${{ inputs.bench_script_compare }}'"
47+
fi
48+
49+
echo "params=$params"
50+
echo "bench_params=$params" >> $GITHUB_ENV
51+
3852
- name: Add comment to PR
3953
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4054
if: ${{ always() && inputs.pr_no != 0 }}
4155
with:
4256
script: |
4357
const pr_no = '${{ inputs.pr_no }}';
4458
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
45-
const params = '${{ inputs.bench_script_params }}';
59+
const params = '${{ env.bench_params }}';
4660
const body = `Compute Benchmarks run (with params: ${params}):\n${url}`;
4761
4862
github.rest.issues.createComment({
@@ -145,7 +159,7 @@ jobs:
145159
--output-html remote
146160
--results-dir ${{ github.workspace }}/results-repo
147161
--output-markdown
148-
${{ inputs.bench_script_params }}
162+
${{ env.bench_params }}
149163
150164
# In case it failed to add a comment, we can still print the results.
151165
- name: Print benchmark results
@@ -168,7 +182,7 @@ jobs:
168182
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
169183
const test_status = '${{ steps.benchmarks.outcome }}';
170184
const job_status = '${{ job.status }}';
171-
const params = '${{ inputs.bench_script_params }}';
185+
const params = '${{ env.bench_params }}';
172186
const body = `Compute Benchmarks run (${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
173187
174188
github.rest.issues.createComment({

0 commit comments

Comments
 (0)