-
Notifications
You must be signed in to change notification settings - Fork 37
164 lines (150 loc) · 6.27 KB
/
benchmark.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Benchmark
on:
workflow_dispatch:
inputs:
exclude-slow-benchmarks:
description: 'Exclude slow benchmarks'
required: true
type: boolean
default: false
exclude-unstable-benchmarks:
description: 'Exclude unstable benchmarks'
required: true
type: boolean
default: false
exclude-release-only-benchmarks:
description: 'Exclude release benchmarks'
required: true
type: boolean
default: false
signing-key-id:
required: true
type: string
default: C8B77BCBE16CD2B94B43F9C8757397B82D4ED7B0
jobs:
get-exclude-dirs:
name: Get exclude directories
runs-on: ubuntu-latest
outputs:
exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }}
steps:
- uses: actions/checkout@v4
- id: get-exclude-dirs
uses: ./.github/actions/get_exclude_dirs
with:
exclude-slow: ${{ github.event.inputs.exclude-slow-benchmarks }}
exclude-unstable: ${{ github.event.inputs.exclude-unstable-benchmarks }}
exclude-release-only: ${{ github.event.inputs.exclude-release-only-benchmarks }}
create-branch-prefix:
uses: ./.github/workflows/create_branch_prefix.yml
with:
prefix: 'benchmark'
version: $(jq -r '.version' package.json)
signing-key-id: ${{ inputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
run-benchmarks:
name: ${{ matrix.benchmark_group.name }}
needs:
- get-exclude-dirs
- create-branch-prefix
strategy:
fail-fast: false
matrix:
benchmark_group:
- {
name: 'Stable Demo',
directories: './examples/stable/demo'
}
- {
name: 'Experimental Demo',
directories: './examples/experimental/demo'
}
- {
name: 'Stable E2E CRPC',
directories: './examples/stable/test/end_to_end/candid_rpc'
}
- {
name: 'Experimental E2E CRPC',
directories: './examples/experimental/test/end_to_end/candid_rpc'
}
- {
name: 'Experimental E2E HTTP Server',
directories: './examples/experimental/test/end_to_end/http_server'
}
- {
name: 'Stable Property CRPC',
directories: './examples/stable/test/property/candid_rpc'
}
- {
name: 'Experimental Property CRPC',
directories: './examples/experimental/test/property/candid_rpc'
}
- {
name: 'Stable Property IC API',
directories: './examples/stable/test/property/ic_api'
}
uses: ./.github/workflows/benchmark_parallel.yml
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
directories: ${{ matrix.benchmark_group.directories }}
exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }}
signing-key-id: ${{ inputs.signing-key-id }}
squash-branches:
needs: [run-benchmarks, create-branch-prefix]
uses: ./.github/workflows/squash_branches.yml
with:
base-branch: ${{ needs.create-branch-prefix.outputs.base-branch }}
branch-prefix: ${{ needs.create-branch-prefix.outputs.branch-prefix }}
commit-message: 'run benchmarks'
signing-key-id: ${{ inputs.signing-key-id }}
secrets:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
analyze-benchmarks:
name: Analyze Benchmark Results
needs:
- squash-branches
- create-branch-prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.create-branch-prefix.outputs.base-branch }}
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/setup_dfx
- name: Install dependencies
run: npm install
- name: Analyze benchmarks
run: npx tsx scripts/analyze_benchmarks/index.ts
- uses: ./.github/actions/commit_and_push
with:
gpg-signing-key: ${{ secrets.GPG_SIGNING_KEY }}
branch-name: ${{ needs.create-branch-prefix.outputs.base-branch }}
commit-message: 'analyze benchmark results'
create-branch: 'false'
signing-key-id: ${{ inputs.signing-key-id }}
create-pr:
needs:
- analyze-benchmarks
- create-branch-prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}
run: |
gh pr create \
--base main \
--head ${{ needs.create-branch-prefix.outputs.base-branch }} \
--title "Benchmark Results for ${{ needs.create-branch-prefix.outputs.base-branch }}" \
--body "Automated PR for benchmark results"