-
Notifications
You must be signed in to change notification settings - Fork 163
172 lines (150 loc) · 5.85 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
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@v4
with:
fetch-depth: 0
- name: Export XCode SDK Root
if: matrix.os == 'macos-latest'
run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
# 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
- 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: ${{ secrets.BENCHMARKS_PUSH_TOKEN }}
# Disable push and deploy GitHub pages branch automatically
auto-push: false
# Github Pages repository name
gh-repository: github.com/metacall/core-benchmarks
# Github Pages branch name
gh-pages-branch: main
# Output directory
benchmark-data-dir-path: ./${{ matrix.os }}
- name: Push benchmark result
if: ${{ github.event_name != 'pull_request' }}
run: |
cd benchmark-data-repository
git push https://[email protected]/metacall/core-benchmarks.git
env:
REPO_KEY: ${{secrets.BENCHMARKS_PUSH_TOKEN}}
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@v4
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
- 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: ${{ secrets.BENCHMARKS_PUSH_TOKEN }}
# Disable push and deploy GitHub pages branch automatically
auto-push: false
# Github Pages repository name
gh-repository: github.com/metacall/core-benchmarks
# Github Pages branch name
gh-pages-branch: main
# Output directory
benchmark-data-dir-path: ./${{ matrix.os }}
- name: Push benchmark result
if: ${{ github.event_name != 'pull_request' }}
run: |
cd benchmark-data-repository
git push https://${REPO_KEY}@github.com/metacall/core-benchmarks.git
env:
REPO_KEY: ${{secrets.BENCHMARKS_PUSH_TOKEN}}