forked from LOOHP/InteractionVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (80 loc) · 3.4 KB
/
Copy pathbenchmark.yml
File metadata and controls
91 lines (80 loc) · 3.4 KB
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
name: A-B Performance Benchmark
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/benchmark.yml'
- 'benchmark/**'
- 'build.gradle.kts'
- 'common/src/main/java/com/loohp/interactionvisualizer/entities/DroppedItemDisplay.java'
- 'common/src/main/java/com/loohp/interactionvisualizer/entities/DroppedItemSpatialIndex.java'
- 'common/src/main/java/com/loohp/interactionvisualizer/entities/VisibilityTokenBucket.java'
permissions:
contents: read
jobs:
benchmark:
name: Paper 26.1.2 A-B benchmark
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "25"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build disposable benchmark plugin
run: ./gradlew benchmarkJar --no-daemon --no-build-cache --rerun-tasks
- name: Download stable Paper 26.1.2
env:
PAPER_USER_AGENT: InteractionVisualizer-Benchmark/1.0 (https://github.com/EllanServer/InteractionVisualizer)
run: |
mkdir -p benchmark-server/plugins
BUILDS=$(curl --fail --silent --show-error \
-H "User-Agent: $PAPER_USER_AGENT" \
https://fill.papermc.io/v3/projects/paper/versions/26.1.2/builds)
PAPER_URL=$(echo "$BUILDS" | jq -r 'first(.[] | select(.channel == "STABLE") | .downloads."server:default".url) // empty')
test -n "$PAPER_URL"
curl --fail --location --show-error \
-H "User-Agent: $PAPER_USER_AGENT" \
--output benchmark-server/server.jar "$PAPER_URL"
cp build/libs/InteractionVisualizer-*-benchmark.jar benchmark-server/plugins/
- name: Configure isolated benchmark server
working-directory: benchmark-server
run: |
echo 'eula=true' > eula.txt
cat > server.properties <<'EOF'
online-mode=false
level-name=benchmark-world
level-type=minecraft:flat
generate-structures=false
spawn-protection=0
view-distance=3
simulation-distance=3
max-players=1
max-tick-time=-1
sync-chunk-writes=false
EOF
- name: Run alternating A-B measurements
working-directory: benchmark-server
run: |
java -Xms2G -Xmx2G -XX:+UseG1GC -jar server.jar --nogui | tee benchmark-server.log
test -f plugins/InteractionVisualizerBenchmark/benchmark-results.jsonl
test -f plugins/InteractionVisualizerBenchmark/benchmark-complete.txt
EXPECTED_RESULTS=$(cat plugins/InteractionVisualizerBenchmark/benchmark-complete.txt)
ACTUAL_RESULTS=$(wc -l < plugins/InteractionVisualizerBenchmark/benchmark-results.jsonl)
test "$ACTUAL_RESULTS" -eq "$EXPECTED_RESULTS"
- name: Publish benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: interactionvisualizer-ab-${{ github.sha }}
path: |
benchmark-server/plugins/InteractionVisualizerBenchmark/benchmark-results.jsonl
benchmark-server/plugins/InteractionVisualizerBenchmark/benchmark-complete.txt
benchmark-server/benchmark-server.log
if-no-files-found: warn
retention-days: 30