1+ # This workflow is used to run benchmarks to compare a pull request (specified by the input 'pull_request')
2+ # and the current master. This workflow assumes the pull requests (mmtk-core PRs and the binding PRs are based on
3+ # their corresponding master). Otherwise the workflow may fail or return unexpected results.
4+
15name : Binding Perf Tests
26
37on :
812 required : true
913
1014jobs :
15+ # Figure out binding PRs.
16+ binding-refs :
17+ uses : ./.github/workflows/pr-binding-refs.yml
18+ with :
19+ pull_request : ${{ github.event.inputs.pull_request }}
20+
21+ # Figure out the core PR. We need to get the specific commit and repo from a pull request number.
22+ mmtk-refs :
23+ runs-on : ubuntu-18.04
24+ outputs :
25+ mmtk_repo : ${{ steps.print.outputs.mmtk_repo }}
26+ mmtk-ref : ${{ steps.print.outputs.mmtk_ref }}
27+ steps :
28+ - name : Get mmtk-core repo from pull_request
29+ uses : actions/github-script@v6
30+ id : core-repo
31+ with :
32+ result-encoding : string
33+ script : |
34+ var res = (await github.rest.pulls.get({
35+ owner: "mmtk",
36+ repo: "mmtk-core",
37+ pull_number: ${{ github.event.inputs.pull_request }}
38+ }))
39+ return res.data.head.repo.full_name
40+ - name : Get mmtk-core refs from pull_request
41+ uses : actions/github-script@v6
42+ id : core-ref
43+ with :
44+ result-encoding : string
45+ script : |
46+ var res = (await github.rest.pulls.get({
47+ owner: "mmtk",
48+ repo: "mmtk-core",
49+ pull_number: ${{ github.event.inputs.pull_request }}
50+ }))
51+ return res.data.head.sha
52+ - id : print
53+ run : |
54+ echo "::set-output name=mmtk_repo::${{ steps.core-repo.outputs.result }}"
55+ echo "::set-output name=mmtk_ref::${{ steps.core-ref.outputs.result }}"
56+
57+ # Run perf compare for JikesRVM
1158 jikesrvm-perf-compare :
1259 runs-on : [self-hosted, Linux, freq-scaling-off]
60+ needs : [binding-refs, mmtk-refs]
1361 steps :
14- - run : echo "PERF_PR=${{ github.event.inputs.pull_request }}" >> $GITHUB_ENV
15- - name : Check Revisions
16- 17- with :
18- token : ${{ secrets.GITHUB_TOKEN }}
19- pull_request : ${{ env.PERF_PR }}
20- default_env : ' JIKESRVM_BINDING_TRUNK_REF=master,MMTK_CORE_TRUNK_REF=master,JIKESRVM_BINDING_BRANCH_REF=master,MMTK_CORE_BRANCH_REF=${{ github.event.pull_request.head.sha }}'
21- # Trunk
62+ # Trunk - we always use master from the mmtk org
2263 # - binding
2364 - name : Checkout JikesRVM Binding Trunk
2465 uses : actions/checkout@v2
2566 with :
2667 repository : mmtk/mmtk-jikesrvm
27- token : ${{ secrets.GITHUB_TOKEN }}
68+ ref : master
2869 path : mmtk-jikesrvm-trunk
29- submodules : true
30- ref : ${{ env.JIKESRVM_BINDING_TRUNK_REF }}
70+ - name : Checkout JikesRVM for Trunk
71+ working-directory : mmtk-jikesrvm-trunk
72+ run : ./.github/scripts/ci-checkout.sh
3173 # - core
3274 - name : Checkout MMTk Core
3375 uses : actions/checkout@v2
3476 with :
35- ref : ${{ env.MMTK_CORE_TRUNK_REF }}
77+ repository : mmtk/mmtk-core
78+ ref : master
3679 path : mmtk-core-trunk
3780 # Branch
3881 # - binding
3982 - name : Checkout JikesRVM Binding Branch
4083 uses : actions/checkout@v2
4184 with :
42- repository : mmtk/mmtk-jikesrvm
43- token : ${{ secrets.GITHUB_TOKEN }}
85+ repository : ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
86+ ref : ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
4487 path : mmtk-jikesrvm-branch
45- submodules : true
46- ref : ${{ env.JIKESRVM_BINDING_BRANCH_REF }}
4788 # - core
4889 - name : Checkout MMTk Core
4990 uses : actions/checkout@v2
5091 with :
51- ref : ${{ env.MMTK_CORE_BRANCH_REF }}
92+ repository : ${{ needs.mmtk-refs.outputs.mmtk_repo }}
93+ ref : ${{ needs.mmtk-refs.outputs.mmtk_ref }}
5294 path : mmtk-core-branch
95+ - name : Checkout JikesRVM for Branch
96+ working-directory : mmtk-jikesrvm-branch
97+ run : ./.github/scripts/ci-checkout.sh
5398 # Checkout perf-kit
5499 - name : Checkout Perf Kit
55100 uses : actions/checkout@v2
56101 with :
57102 repository : mmtk/ci-perf-kit
58- token : ${{ secrets.GITHUB_TOKEN }}
59- ref : " 0.6.5 "
103+ token : ${{ secrets.CI_ACCESS_TOKEN }}
104+ ref : " 0.6.6 "
60105 path : ci-perf-kit
61106 submodules : true
62107 # setup
72117 with :
73118 github-token : ${{ secrets.CI_ACCESS_TOKEN }}
74119 repository : ' mmtk/mmtk-core'
75- number : ${{ env.PERF_PR }}
120+ number : ${{ github.event.inputs.pull_request }}
76121 id : jikesrvm-perf-compare-comment
77122 message : ' Running benchmarks for JikesRVM...'
78123 recreate : true
@@ -100,7 +145,7 @@ jobs:
100145 with :
101146 github-token : ${{ secrets.CI_ACCESS_TOKEN }}
102147 repository : ' mmtk/mmtk-core'
103- number : ${{ env.PERF_PR }}
148+ number : ${{ github.event.inputs.pull_request }}
104149 id : jikesrvm-perf-compare-comment
105150 message : ${{ steps.cat.outputs.text }}
106151 append : true
@@ -114,53 +159,51 @@ jobs:
114159
115160 openjdk-perf-compare :
116161 runs-on : [self-hosted, Linux, freq-scaling-off]
162+ needs : [binding-refs, mmtk-refs]
117163 steps :
118- - run : echo "PERF_PR=${{ github.event.inputs.pull_request }}" >> $GITHUB_ENV
119- - name : Check Revisions
120- 121- with :
122- token : ${{ secrets.GITHUB_TOKEN }}
123- pull_request : ${{ env.PERF_PR }}
124- default_env : ' OPENJDK_BINDING_TRUNK_REF=master,MMTK_CORE_TRUNK_REF=master,OPENJDK_BINDING_BRANCH_REF=master,MMTK_CORE_BRANCH_REF=${{ github.event.pull_request.head.sha }}'
125- # Trunk
164+ # Trunk - we always use master from the mmtk org
126165 # - binding
127166 - name : Checkout OpenJDK Binding Trunk
128167 uses : actions/checkout@v2
129168 with :
130169 repository : mmtk/mmtk-openjdk
131- token : ${{ secrets.GITHUB_TOKEN }}
170+ ref : master
132171 path : mmtk-openjdk-trunk
133- submodules : true
134- ref : ${{ env.OPENJDK_BINDING_TRUNK_REF }}
172+ - name : Checkout OpenJDK for Trunk
173+ working-directory : mmtk-openjdk-trunk
174+ run : ./.github/scripts/ci-checkout.sh
135175 # -core
136176 - name : Checkout MMTk Core
137177 uses : actions/checkout@v2
138178 with :
139- ref : ${{ env.MMTK_CORE_TRUNK_REF }}
179+ repository : mmtk/mmtk-core
180+ ref : master
140181 path : mmtk-core-trunk
141182 # Branch
142183 # - binding
143184 - name : Checkout OpenJDK Binding Branch
144185 uses : actions/checkout@v2
145186 with :
146- repository : mmtk/mmtk-openjdk
147- token : ${{ secrets.GITHUB_TOKEN }}
187+ repository : ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
188+ ref : ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
148189 path : mmtk-openjdk-branch
149- submodules : true
150- ref : ${{ env.OPENJDK_BINDING_BRANCH_REF }}
190+ - name : Checkout OpenJDK for Branch
191+ working-directory : mmtk-openjdk-branch
192+ run : ./.github/scripts/ci-checkout.sh
151193 # - core
152194 - name : Checkout MMTk Core
153195 uses : actions/checkout@v2
154196 with :
155- ref : ${{ env.MMTK_CORE_BRANCH_REF }}
197+ repository : ${{ needs.mmtk-refs.outputs.mmtk_repo }}
198+ ref : ${{ needs.mmtk-refs.outputs.mmtk_ref }}
156199 path : mmtk-core-branch
157200 # checkout perf-kit
158201 - name : Checkout Perf Kit
159202 uses : actions/checkout@v2
160203 with :
161204 repository : mmtk/ci-perf-kit
162- token : ${{ secrets.GITHUB_TOKEN }}
163- ref : " 0.6.5 "
205+ token : ${{ secrets.CI_ACCESS_TOKEN }}
206+ ref : " 0.6.6 "
164207 path : ci-perf-kit
165208 submodules : true
166209 # setup
@@ -176,7 +219,7 @@ jobs:
176219 with :
177220 github-token : ${{ secrets.CI_ACCESS_TOKEN }}
178221 repository : ' mmtk/mmtk-core'
179- number : ${{ env.PERF_PR }}
222+ number : ${{ github.event.inputs.pull_request }}
180223 id : openjdk-perf-compare-comment
181224 message : ' Running benchmarks for OpenJDK...'
182225 recreate : true
@@ -204,7 +247,7 @@ jobs:
204247 with :
205248 github-token : ${{ secrets.CI_ACCESS_TOKEN }}
206249 repository : ' mmtk/mmtk-core'
207- number : ${{ env.PERF_PR }}
250+ number : ${{ github.event.inputs.pull_request }}
208251 id : openjdk-perf-compare-comment
209252 message : ${{ steps.cat.outputs.text }}
210253 append : true
0 commit comments