-
Notifications
You must be signed in to change notification settings - Fork 69
99 lines (91 loc) · 4.22 KB
/
auto-merge.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Auto Merge Binding PRs
# Only trigger on push to master. The workflow needs to use repo secrets.
# Triggering on master can make sure we have secrets.
on:
push:
branches:
- master
jobs:
# Figure out the PR that is merged.
get-merged-pr:
runs-on: ubuntu-latest
outputs:
commit: ${{ steps.get-commit-hash.outputs.commit }}
pr: ${{ steps.get-pr.outputs.pr }}
steps:
- id: get-commit-hash
run: echo "commit=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
- id: get-pr
run: |
PR_NUMBER=$(gh pr list --search "${GITHUB_SHA}" --state merged --repo mmtk/mmtk-core --json number --jq '.[0].number')
echo "pr=$PR_NUMBER" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Figure out binding PRs.
binding-refs:
uses: ./.github/workflows/pr-binding-refs.yml
needs: get-merged-pr
with:
pull_request: ${{ needs.get-merged-pr.outputs.pr }}
check-merge-openjdk-pr:
uses: ./.github/workflows/auto-merge-inner.yml
needs: [get-merged-pr, binding-refs]
with:
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
base_repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo_default }}
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
base_ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref_default }}
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
update_lockfile: cargo build
secrets: inherit
check-merge-jikesrvm-pr:
uses: ./.github/workflows/auto-merge-inner.yml
needs: [get-merged-pr, binding-refs]
with:
repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
base_repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo_default }}
ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
base_ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref_default }}
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
# But we do not have a good option for JikesRVM. The Rust project in JikesRVM needs some source files
# that are generated during its build process. Unless we want to do a full build for JikesRVM, we cannot
# use `cargo build`. So use `cargo generate-lockfile` instead.
update_lockfile: cargo generate-lockfile
secrets: inherit
check-merge-v8-pr:
uses: ./.github/workflows/auto-merge-inner.yml
needs: [get-merged-pr, binding-refs]
with:
repo: ${{ needs.binding-refs.outputs.v8_binding_repo }}
base_repo: ${{ needs.binding-refs.outputs.v8_binding_repo_default }}
ref: ${{ needs.binding-refs.outputs.v8_binding_ref }}
base_ref: ${{ needs.binding-refs.outputs.v8_binding_ref_default }}
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
update_lockfile: cargo build --features nogc
secrets: inherit
check-merge-julia-pr:
uses: ./.github/workflows/auto-merge-inner.yml
needs: [get-merged-pr, binding-refs]
with:
repo: ${{ needs.binding-refs.outputs.julia_binding_repo }}
base_repo: ${{ needs.binding-refs.outputs.julia_binding_repo_default }}
ref: ${{ needs.binding-refs.outputs.julia_binding_ref }}
base_ref: ${{ needs.binding-refs.outputs.julia_binding_ref_default }}
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
# mmtk-julia uses bindgen during building and requires the Julia repo. This is a similar situation
# as mmtk-jikesrvm. To make thigns simpler, we just use `cargo generate-lockfile`.
update_lockfile: cargo generate-lockfile
secrets: inherit
check-merge-ruby-pr:
uses: ./.github/workflows/auto-merge-inner.yml
needs: [get-merged-pr, binding-refs]
with:
repo: ${{ needs.binding-refs.outputs.ruby_binding_repo }}
base_repo: ${{ needs.binding-refs.outputs.ruby_binding_repo_default }}
ref: ${{ needs.binding-refs.outputs.ruby_binding_ref }}
base_ref: ${{ needs.binding-refs.outputs.ruby_binding_ref_default }}
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
update_lockfile: cargo build
secrets: inherit