-
Notifications
You must be signed in to change notification settings - Fork 9
78 lines (77 loc) · 2.71 KB
/
ci.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
name: CI
on:
pull_request:
branches: [ '**' ]
push:
branches: [ '**' ]
tags: [ v* ]
jobs:
ci:
# run on external PRs, but not on internal PRs since those will be run by push to branch
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
cache: 'maven'
- name: Test
run: mvn --batch-mode --update-snapshots verify
benchmark:
needs: [ ci ]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
cache: 'maven'
- name: Run benchmark
run: |
mvn package -DskipTests=true
java -Djmh.executor=VIRTUAL -jar bench/target/benchmarks.jar -i 1 -wi 0 -f 1 -to 1100ms -r 1000ms -rf json
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Check & store benchmark result
uses: benchmark-action/github-action-benchmark@v1
# Only store updated benchmark results on main branch
if: steps.extract_branch.outputs.branch == 'main'
with:
tool: 'jmh'
output-file-path: jmh-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '120%'
# Enable alert commit comment
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@adamw'
# Store benchmark results in the docs folder of the main branch
gh-pages-branch: ${{ steps.extract_branch.outputs.branch }}
benchmark-data-dir-path: 'docs/bench'
skip-fetch-gh-pages: true
- name: Check benchmark result
uses: benchmark-action/github-action-benchmark@v1
# PRs, other branches
if: steps.extract_branch.outputs.branch != 'main'
with:
tool: 'jmh'
output-file-path: jmh-result.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@adamw'
gh-pages-branch: ${{ steps.extract_branch.outputs.branch }}
benchmark-data-dir-path: 'docs/bench'