Repository navigation
140 lines (123 loc) · 4.99 KB
/
Copy pathpr-benchmarks.yml
File metadata and controls
140 lines (123 loc) · 4.99 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
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
---
name: PR Benchmarks
on:
pull_request:
types:
- labeled
permissions: {}
concurrency:
group: pr-benchmarks-${{ github.event.pull_request.number }}
defaults:
run:
shell: bash
jobs:
benchmark:
if: github.event.label.name == 'benchmark'
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- name: base
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.base.sha }}
- name: head
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
sha: ${{ github.event.pull_request.head.sha }}
permissions:
contents: read # checkout only
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout ${{ matrix.name }}
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ matrix.repository }}
ref: ${{ matrix.ref }}
persist-credentials: false
fetch-depth: 0
- name: Setup mise
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
version: v2026.7.5
sha256: 5f7ab76afdf0780d12edeaa67e908094e9ccf7924cfe203e415c1cfb87bbf778
- name: Cache local Maven repository
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-pr-bench-maven-${{ matrix.name }}-${{ matrix.sha }}
restore-keys: |
${{ runner.os }}-pr-bench-maven-
${{ runner.os }}-maven-
- name: Run ${{ matrix.name }} JMH benchmarks
run: mise run benchmark:ci-json
- name: Capture ${{ matrix.name }} runner info
run: |
python3 ./.mise/tasks/generate_benchmark_summary.py \
--write-system-info runner-info.json
- name: Upload ${{ matrix.name }} raw benchmark results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-benchmark-raw-${{ matrix.name }}-${{ env.PR_NUMBER }}-${{ env.HEAD_SHA }}
path: |
benchmark-results.json
runner-info.json
retention-days: 5
summarize:
if: github.event.label.name == 'benchmark'
runs-on: ubuntu-24.04
needs: benchmark
permissions:
contents: read # checkout only
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Checkout PR head
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
fetch-depth: 0
- name: Download base benchmark results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pr-benchmark-raw-base-${{ env.PR_NUMBER }}-${{ env.HEAD_SHA }}
path: /tmp/base-benchmark-results
- name: Download head benchmark results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: pr-benchmark-raw-head-${{ env.PR_NUMBER }}-${{ env.HEAD_SHA }}
path: /tmp/head-benchmark-results
- name: Generate benchmark summary
run: |
python3 ./.mise/tasks/generate_benchmark_summary.py \
--input /tmp/head-benchmark-results/benchmark-results.json \
--baseline /tmp/base-benchmark-results/benchmark-results.json \
--system-info /tmp/head-benchmark-results/runner-info.json \
--baseline-system-info /tmp/base-benchmark-results/runner-info.json \
--output-dir benchmark-results \
--commit-sha "${{ github.event.pull_request.head.sha }}" \
--baseline-sha "${{ github.event.pull_request.base.sha }}"
env:
GITHUB_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
GITHUB_BASE_REPOSITORY: ${{ github.repository }}
- name: Prepare PR comment summary
run: |
cp benchmark-results/README.md pr-benchmark-comment.md
- name: Upload PR benchmark results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-benchmark-results-pr-${{ env.PR_NUMBER }}-${{ env.HEAD_SHA }}
path: benchmark-results
retention-days: 5
- name: Upload PR benchmark comment
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-benchmark-comment-pr-${{ env.PR_NUMBER }}-${{ env.HEAD_SHA }}
path: pr-benchmark-comment.md
retention-days: 5