Skip to content

Commit 76ef95a

Browse files
authored
Let CI use both OpenJDK 11 and OpenJDK 21 (#1419)
When running tests using OpenJDK, including binding tests and performance tests, we use both the `jdk-11` branch and the `jdk-21` branch of the repo https://github.com/mmtk/mmtk-openjdk Specifically, for binding tests, including both minimal tests and extended tests, we split OpenJDK 11 and OpenJDK 21 so that they are treated as two different bindings, and the CI will run tests for OpenJDK 11 and OpenJDK 21 in parallel. For performance tests, we simply use the `jdk-11` branch instead of the `master` branch. Since it points to the same branch as the current `master`, its behavior should not change.
1 parent 172f951 commit 76ef95a

File tree

10 files changed

+140
-43
lines changed

10 files changed

+140
-43
lines changed

.github/workflows/auto-merge.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,26 @@ jobs:
3131
with:
3232
pull_request: ${{ needs.get-merged-pr.outputs.pr }}
3333

34-
check-merge-openjdk-pr:
34+
check-merge-openjdk11-pr:
3535
uses: ./.github/workflows/auto-merge-inner.yml
3636
needs: [get-merged-pr, binding-refs]
3737
with:
38-
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
39-
base_repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo_default }}
40-
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
41-
base_ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref_default }}
38+
repo: ${{ needs.binding-refs.outputs.openjdk11_binding_repo }}
39+
base_repo: ${{ needs.binding-refs.outputs.openjdk11_binding_repo_default }}
40+
ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref }}
41+
base_ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref_default }}
42+
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
43+
update_lockfile: cargo build
44+
secrets: inherit
45+
46+
check-merge-openjdk21-pr:
47+
uses: ./.github/workflows/auto-merge-inner.yml
48+
needs: [get-merged-pr, binding-refs]
49+
with:
50+
repo: ${{ needs.binding-refs.outputs.openjdk21_binding_repo }}
51+
base_repo: ${{ needs.binding-refs.outputs.openjdk21_binding_repo_default }}
52+
ref: ${{ needs.binding-refs.outputs.openjdk21_binding_ref }}
53+
base_ref: ${{ needs.binding-refs.outputs.openjdk21_binding_ref_default }}
4254
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
4355
update_lockfile: cargo build
4456
secrets: inherit

.github/workflows/extended-tests-bindings.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,22 @@ jobs:
6262
# .github/scripts/ci-test.sh
6363
# .github/scripts/ci-style.sh
6464

65-
extended-tests-openjdk:
65+
extended-tests-openjdk11:
6666
needs: binding-refs
6767
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
6868
uses: ./.github/workflows/binding-tests-openjdk.yml
6969
with:
70-
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
71-
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
70+
repo: ${{ needs.binding-refs.outputs.openjdk11_binding_repo }}
71+
ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref }}
72+
test-script: ci-test-extended.sh
73+
74+
extended-tests-openjdk21:
75+
needs: binding-refs
76+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
77+
uses: ./.github/workflows/binding-tests-openjdk.yml
78+
with:
79+
repo: ${{ needs.binding-refs.outputs.openjdk21_binding_repo }}
80+
ref: ${{ needs.binding-refs.outputs.openjdk21_binding_ref }}
7281
test-script: ci-test-extended.sh
7382

7483
extended-tests-jikesrvm:

.github/workflows/merge-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ env:
2626
"style-check/x86_64-unknown-linux-gnu/stable",
2727
"style-check/i686-unknown-linux-gnu/stable",
2828
"style-check/x86_64-apple-darwin/stable",
29-
"extended-tests-openjdk / test",
29+
"extended-tests-openjdk11 / test",
30+
"extended-tests-openjdk21 / test",
3031
"extended-tests-v8",
3132
"extended-tests-jikesrvm",
3233
"extended-tests-julia",

.github/workflows/micro-bm.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
uses: qinsoon/[email protected]
2828
with:
2929
token: ${{ secrets.GITHUB_TOKEN }}
30+
# TODO: If we plan to resurrect micro-bm, we need to get the trunk name from a unique .yml
31+
# file so that all GitHub Actions scripts agree upon which branch is the trunk (e.g.
32+
# jdk-11, jdk-21, ...).
3033
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 }}'
3134
# Trunk
3235
# - binding

.github/workflows/minimal-tests-bindings.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ jobs:
3939
with:
4040
pull_request: ${{ needs.grace-period.outputs.pr-number }}
4141

42-
minimal-tests-openjdk:
42+
minimal-tests-openjdk11:
4343
needs: binding-refs
4444
uses: ./.github/workflows/binding-tests-openjdk.yml
4545
with:
46-
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
47-
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
46+
repo: ${{ needs.binding-refs.outputs.openjdk11_binding_repo }}
47+
ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref }}
48+
test-script: ci-test-minimal.sh
49+
50+
minimal-tests-openjdk21:
51+
needs: binding-refs
52+
uses: ./.github/workflows/binding-tests-openjdk.yml
53+
with:
54+
repo: ${{ needs.binding-refs.outputs.openjdk21_binding_repo }}
55+
ref: ${{ needs.binding-refs.outputs.openjdk21_binding_ref }}
4856
test-script: ci-test-minimal.sh

.github/workflows/perf-compare-ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,15 @@ jobs:
177177
needs: [binding-refs, mmtk-refs]
178178
timeout-minutes: 1440
179179
steps:
180-
# Trunk - we always use master from the mmtk org
180+
# Trunk - we use the default repo and branch as specified in pr-binding-refs.
181+
# TODO: We currently use OpenJDK 11 for performance comparison.
182+
# We should switch to OpenJDK 21 when we are ready, and start a new epoch.
181183
# - binding
182184
- name: Checkout OpenJDK Binding Trunk
183185
uses: actions/checkout@v4
184186
with:
185-
repository: mmtk/mmtk-openjdk
186-
ref: master
187+
repository: ${{ needs.binding-refs.outputs.openjdk11_binding_repo_default }}
188+
ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref_default }}
187189
path: mmtk-openjdk-trunk
188190
- name: Checkout OpenJDK for Trunk
189191
working-directory: mmtk-openjdk-trunk
@@ -200,8 +202,10 @@ jobs:
200202
- name: Checkout OpenJDK Binding Branch
201203
uses: actions/checkout@v4
202204
with:
203-
repository: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
204-
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
205+
# TODO: We currently use OpenJDK 11 for performance comparison.
206+
# We should switch to OpenJDK 21 when we are ready, and start a new epoch.
207+
repository: ${{ needs.binding-refs.outputs.openjdk11_binding_repo }}
208+
ref: ${{ needs.binding-refs.outputs.openjdk11_binding_ref }}
205209
path: mmtk-openjdk-branch
206210
- name: Checkout OpenJDK for Branch
207211
working-directory: mmtk-openjdk-branch

.github/workflows/perf-regression-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ jobs:
129129
uses: actions/checkout@v4
130130
with:
131131
repository: mmtk/mmtk-openjdk
132+
# TODO: We currently use OpenJDK 11 for performance comparison.
133+
# We should switch to OpenJDK 21 when we are ready, and start a new epoch.
134+
ref: jdk-11
132135
path: latest/mmtk-openjdk
133136
- name: Checkout OpenJDK (latest)
134137
working-directory: latest/mmtk-openjdk

.github/workflows/pr-binding-refs.yml

Lines changed: 70 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212
# to specify the binding pull requests. Note if any of the following values are omitted, the default values
1313
# will be used (run with the master in mmtk's binding repos).
1414
# Repo is in the format of user/repo. Ref could be sha or branch name.
15+
#
16+
# Note that OpenJDK 11 and OpenJDK 21 are considered two bindings, and their repo and ref names are
17+
# specified separately. It is allowed to specify one or both of OpenJDK 11 and 21.
18+
#
1519
# ```
1620
# binding-refs
17-
# OPENJDK_BINDING_REPO=xx/xx
18-
# OPENJDK_BINDING_REF=xxxxxx
21+
# OPENJDK11_BINDING_REPO=xx/xx
22+
# OPENJDK11_BINDING_REF=xxxxxx
23+
# OPENJDK21_BINDING_REPO=xx/xx
24+
# OPENJDK21_BINDING_REF=xxxxxx
1925
# JIKESRVM_BINDING_REPO=xx/xx
2026
# JIKESRVM_BINDING_REF=xxxxxx
2127
# V8_BINDING_REPO=xx/xx
@@ -37,18 +43,31 @@ on:
3743
type: string
3844
required: true
3945
outputs:
40-
openjdk_binding_repo:
41-
description: "The repository of OpenJDK binding, such as {user}/{repo}"
42-
value: ${{ jobs.binding-refs.outputs.openjdk_binding_repo}}
43-
openjdk_binding_repo_default:
44-
description: "The default repository of OpenJDK binding, such as {user}/{repo}"
45-
value: ${{ jobs.binding-refs.outputs.openjdk_binding_repo_default }}
46-
openjdk_binding_ref:
47-
description: "The git ref of OpenJDK binding, such as sha and branch name"
48-
value: ${{ jobs.binding-refs.outputs.openjdk_binding_ref}}
49-
openjdk_binding_ref_default:
50-
description: "The default git ref of OpenJDK binding, such as sha and branch name"
51-
value: ${{ jobs.binding-refs.outputs.openjdk_binding_ref_default }}
46+
openjdk11_binding_repo:
47+
description: "The repository of OpenJDK 11 binding, such as {user}/{repo}"
48+
value: ${{ jobs.binding-refs.outputs.openjdk11_binding_repo}}
49+
openjdk11_binding_repo_default:
50+
description: "The default repository of OpenJDK 11 binding, such as {user}/{repo}"
51+
value: ${{ jobs.binding-refs.outputs.openjdk11_binding_repo_default }}
52+
openjdk11_binding_ref:
53+
description: "The git ref of OpenJDK 11 binding, such as sha and branch name"
54+
value: ${{ jobs.binding-refs.outputs.openjdk11_binding_ref}}
55+
openjdk11_binding_ref_default:
56+
description: "The default git ref of OpenJDK 11 binding, such as sha and branch name"
57+
value: ${{ jobs.binding-refs.outputs.openjdk11_binding_ref_default }}
58+
59+
openjdk21_binding_repo:
60+
description: "The repository of OpenJDK 21 binding, such as {user}/{repo}"
61+
value: ${{ jobs.binding-refs.outputs.openjdk21_binding_repo}}
62+
openjdk21_binding_repo_default:
63+
description: "The default repository of OpenJDK 21 binding, such as {user}/{repo}"
64+
value: ${{ jobs.binding-refs.outputs.openjdk21_binding_repo_default }}
65+
openjdk21_binding_ref:
66+
description: "The git ref of OpenJDK 21 binding, such as sha and branch name"
67+
value: ${{ jobs.binding-refs.outputs.openjdk21_binding_ref}}
68+
openjdk21_binding_ref_default:
69+
description: "The default git ref of OpenJDK 21 binding, such as sha and branch name"
70+
value: ${{ jobs.binding-refs.outputs.openjdk21_binding_ref_default }}
5271

5372
jikesrvm_binding_repo:
5473
description: "The repository of JikesRVM binding, such as {user}/{repo}"
@@ -121,8 +140,10 @@ jobs:
121140
binding-refs:
122141
runs-on: ubuntu-latest
123142
env:
124-
OPENJDK_BINDING_REPO_DEFAULT: mmtk/mmtk-openjdk
125-
OPENJDK_BINDING_REF_DEFAULT: master
143+
OPENJDK11_BINDING_REPO_DEFAULT: mmtk/mmtk-openjdk
144+
OPENJDK11_BINDING_REF_DEFAULT: jdk-11
145+
OPENJDK21_BINDING_REPO_DEFAULT: mmtk/mmtk-openjdk
146+
OPENJDK21_BINDING_REF_DEFAULT: jdk-21
126147
JIKESRVM_BINDING_REPO_DEFAULT: mmtk/mmtk-jikesrvm
127148
JIKESRVM_BINDING_REF_DEFAULT: master
128149
V8_BINDING_REPO_DEFAULT: mmtk/mmtk-v8
@@ -134,10 +155,14 @@ jobs:
134155
RUBY_BINDING_REPO_DEFAULT: mmtk/mmtk-ruby
135156
RUBY_BINDING_REF_DEFAULT: master
136157
outputs:
137-
openjdk_binding_repo: ${{ steps.print.outputs.openjdk_binding_repo }}
138-
openjdk_binding_repo_default: ${{ env.OPENJDK_BINDING_REPO_DEFAULT }}
139-
openjdk_binding_ref: ${{ steps.print.outputs.openjdk_binding_ref }}
140-
openjdk_binding_ref_default: ${{ env.OPENJDK_BINDING_REF_DEFAULT }}
158+
openjdk11_binding_repo: ${{ steps.print.outputs.openjdk11_binding_repo }}
159+
openjdk11_binding_repo_default: ${{ env.OPENJDK11_BINDING_REPO_DEFAULT }}
160+
openjdk11_binding_ref: ${{ steps.print.outputs.openjdk11_binding_ref }}
161+
openjdk11_binding_ref_default: ${{ env.OPENJDK11_BINDING_REF_DEFAULT }}
162+
openjdk21_binding_repo: ${{ steps.print.outputs.openjdk21_binding_repo }}
163+
openjdk21_binding_repo_default: ${{ env.OPENJDK21_BINDING_REPO_DEFAULT }}
164+
openjdk21_binding_ref: ${{ steps.print.outputs.openjdk21_binding_ref }}
165+
openjdk21_binding_ref_default: ${{ env.OPENJDK21_BINDING_REF_DEFAULT }}
141166
jikesrvm_binding_repo: ${{ steps.print.outputs.jikesrvm_binding_repo }}
142167
jikesrvm_binding_repo_default: ${{ env.JIKESRVM_BINDING_REPO_DEFAULT }}
143168
jikesrvm_binding_ref: ${{ steps.print.outputs.jikesrvm_binding_ref }}
@@ -164,11 +189,33 @@ jobs:
164189
with:
165190
pull_request: ${{ inputs.pull_request }}
166191
token: ${{ secrets.GITHUB_TOKEN }}
167-
default_env: 'OPENJDK_BINDING_REPO=${{ env.OPENJDK_BINDING_REPO_DEFAULT }},OPENJDK_BINDING_REF=${{ env.OPENJDK_BINDING_REF_DEFAULT }},JIKESRVM_BINDING_REPO=${{ env.JIKESRVM_BINDING_REPO_DEFAULT }},JIKESRVM_BINDING_REF=${{ env.JIKESRVM_BINDING_REF_DEFAULT }},V8_BINDING_REPO=${{ env.V8_BINDING_REPO_DEFAULT }},V8_BINDING_REF=${{ env.V8_BINDING_REF_DEFAULT }},JULIA_BINDING_REPO=${{ env.JULIA_BINDING_REPO_DEFAULT }},JULIA_BINDING_REF=${{ env.JULIA_BINDING_REF_DEFAULT }},JULIA_VM_REPO=${{ env.JULIA_VM_REPO_DEFAULT }},JULIA_VM_REF=${{ env.JULIA_VM_REF_DEFAULT }},RUBY_BINDING_REPO=${{ env.RUBY_BINDING_REPO_DEFAULT }},RUBY_BINDING_REF=${{ env.RUBY_BINDING_REF_DEFAULT }}'
192+
# Note: In the following lines, YAML makes one multi-line string literal from the
193+
# indented lines after the '|' character, and then GitHub Actions replaces '${{ ... }}'
194+
# with the expression values, and finally comment-env-vars parses the value of
195+
# `default_env` (a multi-line string). comment-env-vars splits the string by /[\n\r,]/,
196+
# and keeps only elements that contain non-blank sub-strings separated by '='. Both the
197+
# LHS and RHS of '=' are trimmed.
198+
default_env: |
199+
OPENJDK11_BINDING_REPO=${{ env.OPENJDK11_BINDING_REPO_DEFAULT }}
200+
OPENJDK11_BINDING_REF=${{ env.OPENJDK11_BINDING_REF_DEFAULT }}
201+
OPENJDK21_BINDING_REPO=${{ env.OPENJDK21_BINDING_REPO_DEFAULT }}
202+
OPENJDK21_BINDING_REF=${{ env.OPENJDK21_BINDING_REF_DEFAULT }}
203+
JIKESRVM_BINDING_REPO=${{ env.JIKESRVM_BINDING_REPO_DEFAULT }}
204+
JIKESRVM_BINDING_REF=${{ env.JIKESRVM_BINDING_REF_DEFAULT }}
205+
V8_BINDING_REPO=${{ env.V8_BINDING_REPO_DEFAULT }}
206+
V8_BINDING_REF=${{ env.V8_BINDING_REF_DEFAULT }}
207+
JULIA_BINDING_REPO=${{ env.JULIA_BINDING_REPO_DEFAULT }}
208+
JULIA_BINDING_REF=${{ env.JULIA_BINDING_REF_DEFAULT }}
209+
JULIA_VM_REPO=${{ env.JULIA_VM_REPO_DEFAULT }}
210+
JULIA_VM_REF=${{ env.JULIA_VM_REF_DEFAULT }}
211+
RUBY_BINDING_REPO=${{ env.RUBY_BINDING_REPO_DEFAULT }}
212+
RUBY_BINDING_REF=${{ env.RUBY_BINDING_REF_DEFAULT }}
168213
- id: print
169214
run: |
170-
echo "openjdk_binding_repo=${{ env.OPENJDK_BINDING_REPO }}" >> $GITHUB_OUTPUT
171-
echo "openjdk_binding_ref=${{ env.OPENJDK_BINDING_REF }}" >> $GITHUB_OUTPUT
215+
echo "openjdk11_binding_repo=${{ env.OPENJDK11_BINDING_REPO }}" >> $GITHUB_OUTPUT
216+
echo "openjdk11_binding_ref=${{ env.OPENJDK11_BINDING_REF }}" >> $GITHUB_OUTPUT
217+
echo "openjdk21_binding_repo=${{ env.OPENJDK21_BINDING_REPO }}" >> $GITHUB_OUTPUT
218+
echo "openjdk21_binding_ref=${{ env.OPENJDK21_BINDING_REF }}" >> $GITHUB_OUTPUT
172219
echo "jikesrvm_binding_repo=${{ env.JIKESRVM_BINDING_REPO }}" >> $GITHUB_OUTPUT
173220
echo "jikesrvm_binding_ref=${{ env.JIKESRVM_BINDING_REF }}" >> $GITHUB_OUTPUT
174221
echo "v8_binding_repo=${{ env.V8_BINDING_REPO }}" >> $GITHUB_OUTPUT

.github/workflows/stress-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ jobs:
110110
uses: actions/checkout@v4
111111
with:
112112
repository: mmtk/mmtk-openjdk
113+
# TODO: If we plan to resurrect stress-ci, we need to get the trunk name from a unique .yml
114+
# file so that all GitHub Actions scripts agree upon which branch is the trunk (e.g.
115+
# jdk-11, jdk-21, ...).
113116
token: ${{ secrets.CI_ACCESS_TOKEN }}
114117
path: mmtk-openjdk
115118
submodules: true

docs/team/pull_request.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ can be merged.
1414
If an MMTk core PR should be tested with other bindings PRs, one can specify the binding branch that
1515
should be tested with by adding a comment like below (see https://github.com/mmtk/mmtk-core/blob/master/.github/workflows/pr-binding-refs.yml).
1616
If there are multiple comments that match, the first one is effective. If the info is missing for
17-
a binding, the default repo (`mmtk/mmtk-X`) and branch (`master`) will be used instead.
17+
a binding, the default repo (`mmtk/mmtk-X`) and branch (`master` for most bindings) will be used instead.
18+
19+
Note that OpenJDK 11 and OpenJDK 21 are considered two bindings. Their default repos are both
20+
`mmtk/mmtk-openjdk`, but their default branches are `jdk-11` and `jdk-21`, respectively. We can
21+
speficy the repo and branch of one of OpenJDK 11 and OpenJDK 21, or both.
22+
1823
```
1924
binding-refs
20-
OPENJDK_BINDING_REPO=xx/xx
21-
OPENJDK_BINDING_REF=xxxxxx
25+
OPENJDK11_BINDING_REPO=xx/xx
26+
OPENJDK11_BINDING_REF=xxxxxx
27+
OPENJDK21_BINDING_REPO=xx/xx
28+
OPENJDK21_BINDING_REF=xxxxxx
2229
JIKESRVM_BINDING_REPO=xx/xx
2330
JIKESRVM_BINDING_REF=xxxxxx
2431
V8_BINDING_REPO=xx/xx

0 commit comments

Comments
 (0)