forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (119 loc) · 3.67 KB
/
command-bench.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Command Bench
on:
workflow_dispatch:
inputs:
pr:
description: Number of the Pull Request
required: true
benchmark:
description: Pallet benchmark
type: choice
required: true
options:
- substrate-pallet
- polkadot-pallet
- cumulus-assets
- cumulus-collectives
- cumulus-coretime
- cumulus-bridge-hubs
- cumulus-contracts
- cumulus-glutton
- cumulus-starters
- cumulus-people
- cumulus-testing
subcommand:
description: Subcommand
type: choice
required: true
options:
- pallet
- xcm
runtime:
description: Runtime
type: choice
options:
- dev
- rococo
- westend
- asset-hub-westend
- asset-hub-rococo
- collectives-westend
- coretime-rococo
- coretime-westend
- bridge-hub-rococo
- bridge-hub-westend
- contracts-rococo
- glutton-westend
- glutton-westend-dev-1300
- seedling
- shell
- people-westend
- people-rococo
- penpal
- rococo-parachain
pallet:
description: Pallet
type: string
default: pallet_name
target_dir:
description: Target directory
type: choice
options:
- substrate
- polkadot
- cumulus
runtime_dir:
description: Runtime directory
type: choice
options:
- people
- collectives
- coretime
- bridge-hubs
- contracts
- glutton
- starters
- testing
jobs:
set-image:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
cmd-bench:
needs: [set-image]
runs-on: arc-runners-polkadot-sdk-benchmark
container:
image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- name: Download repo
uses: actions/checkout@v4
- name: Install gh cli
id: gh
uses: ./.github/actions/set-up-gh
with:
pr-number: ${{ inputs.pr }}
GH_TOKEN: ${{ github.token }}
- name: Run bench
run: |
"./scripts/bench.sh" "${{ inputs.benchmark }}" --runtime "${{ inputs.runtime }}" --pallet "${{ inputs.pallet }}" --target_dir "${{ inputs.target_dir }}" --subcommand "${{ inputs.subcommand }}" --runtime_dir "${{ inputs.runtime_dir }}"
- name: Report failure
if: ${{ failure() }}
run: gh pr comment ${{ inputs.pr }} --body "<h2>Command failed ❌</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> failed. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}
- run: git pull --rebase
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: cmd-action - ${{ github.workflow }}
branch: ${{ steps.gh.outputs.branch }}
- name: Report succeed
run: gh pr comment ${{ inputs.pr }} --body "<h2>Action completed 🎉🎉</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> completed 🎉. See logs <a href=\"$RUN\">here</a>."
env:
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GH_TOKEN: ${{ github.token }}