-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (138 loc) · 4.31 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
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
name: Kotlin benchmarks
on:
workflow_dispatch:
permissions:
contents: write
jobs:
get-inputs:
uses: ephemient/aoc2024/.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@v4
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run providedZip
env:
NODE_OPTIONS: --openssl-legacy-provider
- uses: actions/upload-artifact@v4
with:
name: jmh-visualizer
path: jmh-visualizer.zip
assemble:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew assembleBenchmarks
working-directory: kt
build:
needs: [ assemble, get-inputs ]
runs-on: ubuntu-latest
strategy:
matrix:
target: [ jvm, wasmJs, linuxX64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: inputs
path: inputs
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- run: ./gradlew ${{ matrix.target }}BenchBenchmark
working-directory: kt
env:
AOC2024_DATADIR: ${{ github.workspace }}/inputs
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-benchmarks
path: kt/aoc2024-exe/build/reports/benchmarks
graalvm:
needs: [ assemble, get-inputs ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: inputs
path: inputs
- uses: graalvm/setup-graalvm@v1
with:
java-version: 21
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- run: ./gradlew --no-configuration-cache -Pagent nativeBenchmarkRun
working-directory: kt
env:
AOC2024_DATADIR: ${{ github.workspace }}/inputs
- uses: actions/upload-artifact@v4
with:
name: graalvm-benchmarks
path: kt/graalvm/build/reports/benchmarks
docs:
needs: [ jmh-visualizer, build, graalvm ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-docs
- uses: actions/download-artifact@v4
with:
name: jmh-visualizer
- uses: actions/download-artifact@v4
with:
name: jvm-benchmarks
path: benchmarks
- uses: actions/download-artifact@v4
with:
name: wasmJs-benchmarks
path: benchmarks
- uses: actions/download-artifact@v4
with:
name: linuxX64-benchmarks
path: benchmarks
- uses: actions/download-artifact@v4
with:
name: graalvm-benchmarks
path: benchmarks
- run: rm -rf jmh-visualizer
- run: unzip -d jmh-visualizer jmh-visualizer.zip
- name: Create provided.js
run: |
shopt -s failglob globstar
names=() jsonargs=()
for file in benchmarks/**/*.json; do
name=${file##*/}
name=${name%.*}
name=${name%Bench}
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]|sort_by(.benchmark|[split("[.]|(?<!\\d)(?!\\D)|(?<!\\D)(?!\\d)")|map(try tonumber catch .),.]))' "${jsonargs[@]}");
EOF
- uses: EndBug/add-and-commit@v9
with:
add: jmh-visualizer
message: 'kotlinx.benchmark ${{ github.sha }}'