-
Notifications
You must be signed in to change notification settings - Fork 167
235 lines (207 loc) · 7.56 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Benchmarks
on:
pull_request:
push:
tags:
- "v*.*.*"
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
benchmark-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
env:
LTTNG_UST_REGISTER_TIMEOUT: 0
NUGET_XMLDOC_MODE: skip
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
steps:
- name: Check out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
# TODO: Add support for NetCore Bench
- name: Set up the environment
run: |
sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS
env:
METACALL_INSTALL_OPTIONS: base python nodejs ruby # TODO: Implement NetCore once it works with MacOS
- name: Configure
run: |
mkdir -p build
cd build
if [ "$(uname)" == "Darwin" ]; then
. .env
fi
bash ../tools/metacall-configure.sh $METACALL_CONFIGURE_OPTIONS
env:
METACALL_CONFIGURE_OPTIONS: release scripts python nodejs ruby benchmarks # TODO: Implement NetCore once it works with MacOS
- name: Build
working-directory: ./build
# TODO: Remove the disable option for fork safe once funchook problem is solved
run: |
if [ "$(uname)" == "Darwin" ]; then
. .env
fi
cmake -DOPTION_FORK_SAFE=OFF ..
bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS
env:
METACALL_BUILD_OPTIONS: release benchmarks
- name: Merge benchmarks
if: ${{ github.event_name != 'pull_request' }}
run: python3 ./tools/metacall-benchmarks-merge.py ./build/benchmarks
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
if: ${{ github.event_name != 'pull_request' }}
with:
path: ./cache
key: ${{ matrix.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.event_name != 'pull_request' }}
with:
name: MetaCall Benchmark (${{ matrix.os }})
tool: 'googlecpp'
output-file-path: ./build/benchmarks/metacall-benchmarks.json
# Access token to deploy GitHub Pages branch
github-token: ""
# Disable push and deploy GitHub pages branch automatically
auto-push: false
skip-fetch-gh-pages: true
# Github Pages branch name
gh-pages-branch: ${{ github.head_ref || github.ref_name }}
# Output directory
benchmark-data-dir-path: bench/${{ matrix.os }}
# Where the previous data file is stored
external-data-json-path: ./cache/metacall-benchmarks.json
# Upload benchmark artifacts
- name: Upload benchmark artifact
uses: actions/upload-artifact@master
if: ${{ github.event_name != 'pull_request' }}
with:
name: ${{ matrix.os }}-benchmark
path: ./bench/
benchmark-windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
env:
LTTNG_UST_REGISTER_TIMEOUT: 0
NUGET_XMLDOC_MODE: skip
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
steps:
- name: Check out the repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Activate the Visual Studio Developer Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Set up the environment
run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS"
env:
METACALL_INSTALL_OPTIONS: python nodejs ruby # TODO: Implement NetCore once it works with Windows
# TODO: Use release when this bug is solved: https://github.com/metacall/core/issues/461
- name: Configure
run: |
$METACALL_PATH = $PWD
md -Force "$METACALL_PATH\build"
cd "$METACALL_PATH\build"
cmd.exe /c "powershell ..\tools\metacall-configure.ps1 $Env:METACALL_BUILD_OPTIONS"
env:
METACALL_BUILD_OPTIONS: debug scripts python nodejs ruby benchmarks # TODO: Implement NetCore once it works with Windows
# TODO: Use release when this bug is solved: https://github.com/metacall/core/issues/461
- name: Build
working-directory: ./build
run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS"
env:
METACALL_BUILD_OPTIONS: debug benchmarks
- name: Merge benchmarks
if: ${{ github.event_name != 'pull_request' }}
run: python3 ./tools/metacall-benchmarks-merge.py ./build/benchmarks
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v1
if: ${{ github.event_name != 'pull_request' }}
with:
path: ./cache
key: ${{ matrix.os }}-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
if: ${{ github.event_name != 'pull_request' }}
with:
name: MetaCall Benchmark (${{ matrix.os }})
tool: 'googlecpp'
output-file-path: ./build/benchmarks/metacall-benchmarks.json
# Access token to deploy GitHub Pages branch
github-token: ""
# Disable push and deploy GitHub pages branch automatically
auto-push: false
skip-fetch-gh-pages: true
# Github Pages branch name
gh-pages-branch: ${{ github.head_ref || github.ref_name }}
# Output directory
benchmark-data-dir-path: bench/${{ matrix.os }}
# Where the previous data file is stored
external-data-json-path: ./cache/metacall-benchmarks.json
# Upload benchmark artifacts
- name: Upload benchmark artifact
uses: actions/upload-artifact@master
if: ${{ github.event_name != 'pull_request' }}
with:
name: ${{ matrix.os }}-benchmark
path: ./bench/
# This job will merge all benchmarks into one artifact
benchmark-upload:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
needs: [benchmark-unix, benchmark-windows]
steps:
# Ubuntu
- uses: actions/download-artifact@master
with:
name: ubuntu-latest-benchmark
path: ./bench/
# MacOS
- uses: actions/download-artifact@master
with:
name: macos-latest-benchmark
path: ./bench/
# Windows
- uses: actions/download-artifact@master
with:
name: windows-2019-benchmark
path: ./bench/
# Upload benchmark website artifacts
- name: Upload benchmark artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./bench/
name: benchmarks
benchmark-deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
needs: [benchmark-upload]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
artifact_name: benchmarks