-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (87 loc) · 3.05 KB
/
Copy pathPRBuildBenchmark.yml
File metadata and controls
109 lines (87 loc) · 3.05 KB
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
103
104
105
106
107
108
109
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: On Demand Build Benchmarking
on:
issue_comment:
types: [created]
jobs:
build-head:
runs-on: ubuntu-latest
steps:
- uses: khan/pull-request-comment-trigger@master
id: check
with:
trigger: 'benchmark-build'
- run: 'echo Running Benchmark Now!'
if: steps.check.outputs.triggered == 'true'
- uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Clone head commit
- name: Clone Repo
uses: actions/checkout@v2
with:
submodules: recursive
ref: ${{ steps.comment-branch.outputs.head_ref }}
# Test if correct commit is checked out
- name: Print File Content
run: cat test-checkout.txt
# Setup JDK on container
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install SDKMAN, Gradle Profiler and Begin Profiling
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install gradleprofiler 0.12.0
gradle-profiler --benchmark --scenario-file build_performance.scenarios --warmups 1 --iteration 1
- uses: actions/upload-artifact@v2
with:
name: head-benchmark
path: profile-out/benchmark.csv
build-base:
needs: build-head
runs-on: ubuntu-latest
steps:
- uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Clone base commit
- name: Clone Repo
uses: actions/checkout@v2
with:
submodules: recursive
ref: ${{ steps.comment-branch.outputs.base_ref }}
# Test if correct commit is checked out
- name: Print File Content
run: cat test-checkout.txt
# Setup JDK on container
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install SDKMAN, Gradle Profiler and Begin Profiling
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install gradleprofiler 0.12.0
gradle-profiler --benchmark --scenario-file build_performance.scenarios --warmups 1 --iteration 1
- uses: actions/upload-artifact@v2
name: Archive Benchmark Result File
with:
name: base-benchmark
path: profile-out/benchmark.csv
- uses: actions/download-artifact@v2
with:
name: head-benchmark
path: profile-out-head
- run: ls profile-out-head
name: Debug step- Check if file was downloaded properly
- name: Print Difference
run: |
chmod +x benchmark-difference.py
python benchmark-difference.py