-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (74 loc) · 2.29 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Benchmark ⌛
on:
workflow_call:
inputs:
runner:
type: string
description: 'The machine runner the workflow should run on'
default: macos-latest
required: false
branch:
type: string
description: 'The branch to be benchmarked'
required: true
should-commit-benchmark:
type: boolean
description: 'If the produced report should be commited to the active branch'
default: false
required: false
workflow_dispatch:
inputs:
runner:
type: string
description: 'The machine runner the workflow should run on'
default: macos-latest
required: true
branch:
type: string
description: 'The branch to be benchmarked'
required: true
should-commit-benchmark:
type: boolean
description: 'If the produced report should be committed to the active branch'
default: false
required: false
jobs:
build:
runs-on: ${{ inputs.runner }}
permissions:
contents: write
steps:
- name: Clone Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Set up jdk@21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Execute Gradle build
run: ./gradlew benchmark --no-configuration-cache
- name: Upload any new reports
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/**/*Benchmark.csv
**/build/**/*Benchmark.json
- name: Move benchmark files
run: |
mkdir -p benchmark/reports
find benchmark -type f \( -iname '*benchmark.json' -o -iname '*benchmark.csv' \) -exec mv {} ./benchmark/reports/ \;
- name: Commit benchmark files
if: ${{ inputs.should-commit-benchmark }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add benchmark/*
git commit -m "Commit benchmark results" -a
git push