|
1 | 1 | # This workflow runs the desired benchmarks on demand.
|
2 | 2 | #
|
3 | 3 | # 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]" |
5 | 5 | # The this workflow will run the benchmark with the given NAME, first against
|
6 | 6 | # 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. |
8 | 10 |
|
9 | 11 | name: "🚀 Manual Benchmark"
|
10 | 12 |
|
@@ -46,13 +48,14 @@ jobs:
|
46 | 48 | uses: actions/github-script@main
|
47 | 49 | with:
|
48 | 50 | script: |
|
49 |
| - const regex = /^\/benchmark\s*([^\s]*)\s*$/; |
| 51 | + const regex = /^\/benchmark\s*([^\s]*)\s*(ghc810|ghc96|ghc98|ghc910)?\s*$/; |
50 | 52 | const comment = context.payload.comment.body;
|
51 | 53 | const match = comment.match(regex)
|
52 |
| - if (match !== null && match.length == 2 && match[1] !== '') { |
| 54 | + if (match !== null && match.length == 3 && match[1] !== '') { |
53 | 55 | core.setOutput('benchmark', match[1]);
|
| 56 | + core.setOutput('ghc', match[2] || 'ghc96'); |
54 | 57 | } 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}'`); |
56 | 59 | }
|
57 | 60 |
|
58 | 61 | - name: Extract Branch Name
|
@@ -117,7 +120,10 @@ jobs:
|
117 | 120 |
|
118 | 121 | - name: Run Benchmark
|
119 | 122 | 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 |
121 | 127 | env:
|
122 | 128 | BENCHMARK_NAME: ${{ steps.extract-benchmark.outputs.benchmark }}
|
123 | 129 | PR_NUMBER: ${{ github.event.issue.number }}
|
|
0 commit comments