-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (72 loc) · 2.22 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
name: Benchmark ⌛
on:
workflow_call:
inputs:
runner:
type: string
description: 'The machine runner the workflow should run on'
default: macos-13
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-13
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@v3
with:
distribution: 'corretto'
java-version: '21'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew benchmark
- name: Upload any new reports
uses: actions/upload-artifact@v3
with:
name: reports
path: |
**/build/**/*Benchmark.csv
**/build/**/*Benchmark.json
- name: Move benchmark files
run: |
mkdir -p benchmark # This command ensures that the 'benchmark' directory exists
find . -type f \( -iname '*benchmark.json' -o -iname '*benchmark.csv' \) -exec mv {} ./benchmark/ \;
- name: Commit benchmark files
if: ${{ inputs.should-commit-benchmark }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add benchmark/*
git commit -m "Commit benchmark results" -a
git push