Skip to content

Commit ac8c57e

Browse files
authored
Merge pull request #522 from skyleaworlder/dev-benchmark-trigger
Add a new workflow to trigger the benchmark workflow
2 parents e06b8a5 + fb690ad commit ac8c57e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Benchmark Trigger
2+
3+
on:
4+
pull_request_target:
5+
types: [ labeled ]
6+
workflow_dispatch:
7+
inputs:
8+
pr_id:
9+
type: string
10+
description: id of the pull request that triggers this workflow
11+
target_url:
12+
type: string
13+
description: url of target
14+
baseline_url:
15+
type: string
16+
description: url of baseline
17+
18+
jobs:
19+
benchmark_trigger:
20+
if: ${{ github.event.label.name == 'benchmark' }}
21+
runs-on: ubuntu-latest
22+
env:
23+
REPOSITORY: ${{ github.event.repository.full_name }}
24+
PR_ID: ${{ github.event.inputs.pr_id || github.event.pull_request.number }}
25+
TARGET_URL: ${{ github.event.inputs.target_url || format('{0}#{1}', github.event.pull_request.head.repo.html_url, github.event.pull_request.head.sha) }}
26+
BASELINE_URL: ${{ github.event.inputs.baseline_url || format('{0}#{1}', github.event.pull_request.base.repo.html_url, github.event.pull_request.base.sha) }}
27+
steps:
28+
-
29+
name: Get app installation token (ghs)
30+
id: get-app-token
31+
uses: tibdex/github-app-token@v1
32+
with:
33+
app_id: ${{ secrets.BENCH_APP_ID }}
34+
installation_id: ${{ secrets.BENCH_INSTALL_ID }}
35+
private_key: ${{ secrets.BENCH_PRIVATE_KEY }}
36+
-
37+
uses: benc-uk/workflow-dispatch@v1
38+
with:
39+
repo: FluxML/FluxMLBenchmarks.jl
40+
workflow: Benchmark.yml
41+
token: ${{ steps.get-app-token.outputs.token }}
42+
inputs: '{ "repo": $REPOSITORY, "pr_id": $PR_ID, "target_url": $TARGET_URL, "baseline_url": $BASELINE_URL }'

0 commit comments

Comments
 (0)