-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (101 loc) · 3.56 KB
/
benchmark.yaml
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
# This file was generated using Kotlin DSL (.github/workflows/benchmark.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Run Benchmarks'
on:
push:
branches:
- 'main'
pull_request: {}
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/benchmark.yaml'' && ''.github/workflows/benchmark.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/benchmark.yaml'''
run-benchmark:
name: 'Performance regression check on ${{ matrix.os }} runner'
runs-on: '${{ matrix.os }}'
needs:
- 'check_yaml_consistency'
strategy:
fail-fast: true
matrix:
include:
- os: 'ubuntu-latest'
- os: 'macos-latest'
additional-args: '-x jvmBenchmark -x jsBenchmark'
- os: 'macos-13'
additional-args: '-x jvmBenchmark -x jsBenchmark'
- os: 'windows-latest'
additional-args: '-x jvmBenchmark -x jsBenchmark'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up Gradle Daemon JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '21'
distribution: 'temurin'
- id: 'step-2'
name: 'Validate Gradle Wrapper'
uses: 'gradle/actions/wrapper-validation@v4'
- id: 'step-3'
name: 'Setup Gradle'
uses: 'gradle/actions/setup-gradle@v4'
with:
gradle-version: 'wrapper'
- id: 'step-4'
name: 'Run benchmarks'
run: './gradlew -p snake-kmp-benchmarks benchmark --no-parallel ${{ matrix.additional-args }}'
- id: 'step-5'
uses: 'actions/upload-artifact@v4'
with:
name: 'bench-results-${{ matrix.os }}'
path: 'snake-kmp-benchmarks/build/reports/benchmarks/main/**/*.json'
collect-benchmarks-results:
runs-on: 'ubuntu-latest'
needs:
- 'run-benchmark'
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Download benchmark results'
uses: 'actions/download-artifact@v4'
with:
path: 'bench-results'
pattern: 'bench-results-*'
merge-multiple: 'true'
- id: 'step-2'
name: 'Prepare and join benchmark reports'
env:
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
run: 'GHWKT_RUN_STEP=''collect-benchmarks-results:step-2'' ''.github/workflows/benchmark.main.kts'''
- id: 'step-3'
name: 'Store benchmark result'
uses: 'benchmark-action/github-action-benchmark@v1'
with:
name: 'SnakeKMP benchmarks'
tool: 'jmh'
output-file-path: 'aggregated.json'
gh-repository: 'github.com/krzema12/snakeyaml-engine-kmp-benchmarks'
github-token: '${{ secrets.PUBLISH_BENCHMARK_RESULTS || github.token }}'
auto-push: '${{ github.repository == ''krzema12/snakeyaml-engine-kmp'' && github.event_name != ''pull_request'' }}'
summary-always: 'true'
comment-on-alert: '${{ github.event.pull_request.head.repo.full_name == ''krzema12/snakeyaml-engine-kmp'' }}'
alert-threshold: '150%'
fail-threshold: '200%'