-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (73 loc) · 2.4 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
name: Kotlin benchmarks
on:
workflow_dispatch:
jobs:
get-inputs:
uses: ephemient/aoc2021/.github/workflows/get-inputs.yml@main
secrets:
SESSION: ${{ secrets.SESSION }}
jmh-visualizer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: jzillmann/jmh-visualizer
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-jmh-visualizer-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-jmh-visualizer-
- run: npm install
- run: npm run providedZip
- uses: actions/upload-artifact@v2
with:
name: jmh-visualizer
path: jmh-visualizer.zip
build:
needs: [ get-inputs, jmh-visualizer ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
ref: gh-docs
path: gh-docs
- uses: actions/download-artifact@v2
with:
name: inputs
- uses: actions/download-artifact@v2
with:
name: jmh-visualizer
- run: rm -rf gh-docs/jmh-visualizer
- run: unzip -d gh-docs/jmh-visualizer jmh-visualizer.zip
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 17
cache: gradle
- run: ./gradlew --no-daemon --info benchmark
working-directory: kt
- name: Create provided.js
run: |
shopt -s failglob
names=() jsonargs=()
for file in kt/build/reports/benchmarks/main/*/*.json; do
name=${file##*/}
name=${name%.*}
names+=("$name")
jsonargs+=(--slurpfile "$name" "$file")
done
cat >gh-docs/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@v7
with:
cwd: gh-docs
branch: gh-docs
add: jmh-visualizer
message: 'kotlinx.benchmark ${{ github.sha }}'