forked from hanabi1224/Programming-Language-Benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 1
350 lines (350 loc) · 10.2 KB
/
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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
name: bench
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
env:
PROFILE: /tmp/.tmpprofile
# https://doc.rust-lang.org/cargo/reference/profiles.html#incremental
CARGO_INCREMENTAL: 1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
lang: [
acton,
c,
chapel,
codon,
cpp,
csharp,
crystal,
d,
dart,
# elixir,
# fortran,
go,
# hacklang,
# haskell,
haxe,
java,
javascript,
julia,
kotlin,
# lisp,
lua,
# nelua,
nim,
ocaml,
odin,
perl,
php,
# pony,
python,
# racket,
ruby,
rust,
swift,
typescript,
v,
wasm,
# wren,
zig,
]
steps:
- run: lscpu
- run: dotnet --info
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.x"
- name: Install
run: |
echo '# placeholder' > $PROFILE
dotnet --info
sudo apt-get update -y
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install acton
if: matrix.lang == 'acton'
run: ./.github/acton.sh
- name: Install codon
if: matrix.lang == 'codon'
run: ./.github/codon.sh
- name: Install rust stable
uses: actions-rs/toolchain@v1
if: matrix.lang == 'rust' || matrix.lang == 'wasm'
with:
toolchain: stable
override: true
- name: Install rust nightly
if: matrix.lang == 'rust'
run: |
# https://github.com/rust-lang/portable-simd/issues/156
# rustup update nightly-2021-08-28
# sudo ln -sf $HOME/.rustup/toolchains/nightly-2021-08-28-x86_64-unknown-linux-gnu $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu
rustup update nightly
cargo +nightly --version
# - name: Install graal
# if: matrix.lang == 'java' || matrix.lang == 'javascript' || matrix.lang == 'python' || matrix.lang == 'ruby' || matrix.lang == 'wasm'
# run: ./.github/graalvm.sh
- name: Install clang deps
if: matrix.lang == 'c' || matrix.lang == 'cpp'
run: ./.github/clang.sh
# - name: Install c deps
# if: matrix.lang == 'c'
# run: ./.github/c.sh
# - name: Install cpp deps
# if: matrix.lang == 'cpp'
# run: ./.github/cpp.sh
- name: Install lisp
if: matrix.lang == 'lisp'
env:
LISP: sbcl-bin
run: ./.github/lisp.sh
- name: Install racket
if: matrix.lang == 'racket'
run: ./.github/racket.sh
- name: Install fortran
if: matrix.lang == 'fortran'
run: ./.github/fortran.sh
- name: Install lua
if: matrix.lang == 'lua'
run: ./.github/lua.sh
- name: Install dotnet
if: matrix.lang == 'csharp'
run: ./.github/dotnet.sh
# - name: Install graalvm native-image
# if: matrix.lang == 'java'
# run: ./.github/graalvm-native-image.sh
# - name: Install graalnode
# if: matrix.lang == 'javascript'
# run: ./.github/graalvm-node.sh
- name: Install bun
if: matrix.lang == 'javascript'
run: ./.github/bun.sh
- uses: julia-actions/setup-julia@v1
if: matrix.lang == 'julia'
- name: Install haxe
if: matrix.lang == 'haxe'
run: |
./.github/haxe.sh
./.github/hashlink.sh
- name: Install zig
if: matrix.lang == 'zig' || matrix.lang == 'c' || matrix.lang == 'cpp' || matrix.lang == 'v'
run: ./.github/zig.sh
- name: Install crystal
if: matrix.lang == 'crystal'
run: ./.github/crystal.sh
- name: Install hhvm
if: matrix.lang == 'hacklang'
run: ./.github/hhvm.sh
- name: Install nelua
if: matrix.lang == 'nelua'
run: ./.github/nelua.sh
- name: Install odin
if: matrix.lang == 'odin'
run: ./.github/odin.sh
- uses: dlang-community/setup-dlang@v1
if: matrix.lang == 'd'
with:
compiler: dmd-latest
- uses: dlang-community/setup-dlang@v1
if: matrix.lang == 'd'
with:
compiler: ldc-latest
- name: Install nim
if: matrix.lang == 'nim'
run: ./.github/nim.sh
- uses: shogo82148/actions-setup-perl@v1
if: matrix.lang == 'perl'
with:
perl-version: "5"
multi-thread: true
# - uses: ocaml/setup-ocaml@v2
# if: matrix.lang == 'ocaml'
# with:
# ocaml-compiler: 4.x
# dune-cache: true
# # opam-disable-sandboxing: true
- name: Install PHP
if: matrix.lang == 'php'
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
- name: Install python
if: matrix.lang == 'python'
uses: actions/setup-python@v4
with:
python-version: "3.x"
check-latest: true
- name: Install python ext
if: matrix.lang == 'python'
run: ./.github/python.sh
- name: Install ruby
if: matrix.lang == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: 3 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# - name: Install truffleruby
# if: matrix.lang == 'ruby'
# run: ./.github/truffleruby.sh
- name: Install dart
if: matrix.lang == 'dart'
run: ./.github/dart.sh
- name: Install v
if: matrix.lang == 'v'
run: ./.github/v.sh
- name: Install deno
if: matrix.lang == 'typescript' || matrix.lang == 'wasm'
run: ./.github/deno.sh
- name: Install wasm
if: matrix.lang == 'wasm'
run: ./.github/wasm.sh
- run: dotnet --info
- name: Build
run: |
source $PROFILE
pushd bench
dotnet run -c Release --project tool -- --task build --langs ${{ matrix.lang }}
popd
- name: Test
run: |
source $PROFILE
pushd bench
dotnet run -c Release --project tool -- --task test --langs ${{ matrix.lang }}
popd
- uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: build
path: bench/build/**/*
if-no-files-found: error
gate:
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
steps:
- run: echo 'dummy step as PR gate'
bench:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
steps:
- run: lscpu
- uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.x"
- name: Install
run: |
dotnet --info
echo '# placeholder' > $PROFILE
sudo apt-get update -y
- uses: actions/checkout@v3
- name: Check CPU Model
run: |
source $PROFILE
pushd bench
dotnet run -c Release --project tool -- --task checkcpu
popd
- run: ./.github/acton.sh
- run: ./.github/codon.sh
- run: ./.github/clang.sh
- run: ./.github/crystal.sh
- run: ./.github/dotnet.sh
# - run: ./.github/graalvm.sh
# - run: ./.github/graalvm-node.sh
- run: ./.github/bun.sh
# - run: ./.github/truffleruby.sh
- run: ./.github/wasm.sh
# - run: ./.github/fortran.sh
- uses: julia-actions/setup-julia@v1
- run: ./.github/lua.sh
# - run: ./.github/racket.sh
- run: ./.github/hashlink.sh
# - run: ./.github/hhvm.sh
# - run: ./.github/dart.sh
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5"
multi-thread: true
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
- uses: actions/setup-python@v4
with:
python-version: "3.x"
check-latest: true
- run: ./.github/python.sh
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: actions/download-artifact@v3
with:
name: build
path: bench/build/
- name: Bench
run: |
source $PROFILE
pushd bench
dotnet run -c Release --project tool -- --task test --ignore-missing
dotnet run -c Release --project tool -- --task bench --ignore-missing
popd
- uses: actions/upload-artifact@v3
with:
name: log
path: bench/build/_results/**/*
if-no-files-found: error
publish:
if: github.ref == 'refs/heads/main'
needs: [bench]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/download-artifact@v3
with:
# Artifact name
name: log
# Destination path
path: bench/build/_results/
- name: Install
run: |
ls -al bench/build/_results/
- name: Site Update Content
run: |
pushd website
pnpm i
pnpm content
- name: Site Publish
if: github.ref == 'refs/heads/main'
env:
VERCEL_PUBLISH_TOKEN: ${{ secrets.VERCEL_PUBLISH_TOKEN }}
run: vercel website --prod --confirm -t $VERCEL_PUBLISH_TOKEN || echo 'ignore errors'