-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.45 KB
/
benchmark.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
---
name: benchmark
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
benchmark:
name: run jmh benchmark
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
- name: cache maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: run benchmark
run: |
mvn -DskipTests=true -Pfull --also-make --projects benchmark clean package
java -jar benchmark/target/benchmarks.jar -rf json
- name: download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
- name: store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: jmh Benchmark
tool: 'jmh'
output-file-path: jmh-result.json
external-data-json-path: ./cache/benchmark-data.json
alert-threshold: '200%'
comment-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-alert: true
- name: update benchmark-data
if: ${{ github.ref == 'refs/heads/main' }}
run: |
cp jmh-result.json ./cache/benchmark-data.json