-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (100 loc) · 3 KB
/
kt-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
name: Kotlin benchmarks
on:
workflow_dispatch:
permissions:
contents: write
jobs:
get-inputs:
uses: ephemient/aoc2023/.github/workflows/get-inputs.yml@main
secrets:
SESSION: ${{ secrets.SESSION }}
jmh-visualizer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: jzillmann/jmh-visualizer
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run providedZip
- uses: actions/upload-artifact@v3
with:
name: jmh-visualizer
path: jmh-visualizer.zip
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: inputs
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
arguments: assembleBenchmarks
build-root-directory: kt
- uses: actions/upload-artifact@v3
with:
name: jvmBench
path: kt/aoc2023-exe/build/benchmarks/*/jars/*.jar
run:
needs: [ get-inputs, jmh-visualizer, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-docs
- uses: actions/download-artifact@v3
with:
name: inputs
path: inputs
- uses: actions/download-artifact@v3
with:
name: jmh-visualizer
- uses: actions/download-artifact@v3
with:
name: jvmBench
- run: rm -rf jmh-visualizer
- run: unzip -d jmh-visualizer jmh-visualizer.zip
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Run JVM benchmarks
run: |
cat >config <<EOF
name:jvmBench
reportFile:jvmBench.json
traceFormat:text
warmups:1
iterationTime:1
outputTimeUnit:SECONDS
EOF
java -cp jvmBench/jars/*.jar kotlinx.benchmark.jvm.JvmBenchmarkRunnerKt config
env:
AOC2023_DATADIR: inputs
- name: Create provided.js
run: |
shopt -s failglob
names=() jsonargs=()
for file in *.json; do
name=${file##*/}
name=${name%.*}
names+=("$name")
jsonargs+=(--slurpfile "$name" "$file")
done
cat >jmh-visualizer/provided.js <<EOF
// provided.js - generated by ${{ github.repository }}/${{ github.workflow }}, $(date +'%Y-%m-%d %H:%M:%S.%N')
var providedBenchmarks = $(jq --null-input --compact-output '$ARGS.positional|unique' --args "${names[@]}");
var providedBenchmarkStore = $(jq --null-input '$ARGS.named|map_values(.[0])' "${jsonargs[@]}");
EOF
- uses: EndBug/add-and-commit@v9
with:
add: jmh-visualizer
message: 'kotlinx.benchmark ${{ github.sha }}'