Skip to content

Commit a48ebd7

Browse files
authored
Add option to include the ghc version in manual-benchmark.yml (#6967)
1 parent 7e5c88a commit a48ebd7

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/manual-benchmark.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# This workflow runs the desired benchmarks on demand.
22
#
33
# This workflow triggers whenever a comment is created in any PR.
4-
# If the comment has this format: "/benchmark NAME"
4+
# If the comment has this format: "/benchmark NAME [GHC]"
55
# The this workflow will run the benchmark with the given NAME, first against
66
# the current branch and then comparing the results against the master branch.
7-
7+
# If the optional [GHC] is provided, the benchmark will be run with the given
8+
# GHC version (one of ghc810, ghc96, ghc98, ghc910), otherwise the default GHC
9+
# version (ghc96) will be used.
810

911
name: "🚀 Manual Benchmark"
1012

@@ -46,13 +48,14 @@ jobs:
4648
uses: actions/github-script@main
4749
with:
4850
script: |
49-
const regex = /^\/benchmark\s*([^\s]*)\s*$/;
51+
const regex = /^\/benchmark\s*([^\s]*)\s*(ghc810|ghc96|ghc98|ghc910)?\s*$/;
5052
const comment = context.payload.comment.body;
5153
const match = comment.match(regex)
52-
if (match !== null && match.length == 2 && match[1] !== '') {
54+
if (match !== null && match.length == 3 && match[1] !== '') {
5355
core.setOutput('benchmark', match[1]);
56+
core.setOutput('ghc', match[2] || 'ghc96');
5457
} else {
55-
core.setFailed(`Unable to extract benchmark name from comment '${comment}'`);
58+
core.setFailed(`Unable to extract benchmark name and ghc version from comment '${comment}'`);
5659
}
5760
5861
- name: Extract Branch Name
@@ -117,7 +120,10 @@ jobs:
117120
118121
- name: Run Benchmark
119122
run: |
120-
nix develop --no-warn-dirty --accept-flake-config --command bash ./scripts/ci-plutus-benchmark.sh
123+
nix develop .#${{ steps.extract-benchmark.outputs.ghc }} \
124+
--no-warn-dirty \
125+
--accept-flake-config \
126+
--command bash ./scripts/ci-plutus-benchmark.sh
121127
env:
122128
BENCHMARK_NAME: ${{ steps.extract-benchmark.outputs.benchmark }}
123129
PR_NUMBER: ${{ github.event.issue.number }}

0 commit comments

Comments
 (0)