Skip to content

Commit d5202a4

Browse files
authored
Enable the GitHub merge queue (servo#29989)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
1 parent 9eee517 commit d5202a4

File tree

8 files changed

+59
-56
lines changed

8 files changed

+59
-56
lines changed

.github/workflows/linux-wpt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux WPT workflow
1+
name: Linux WPT Tests
22
on:
33
workflow_call:
44
inputs:
@@ -15,7 +15,7 @@ env:
1515

1616
jobs:
1717
linux-wpt:
18-
name: Linux WPT Tests ${{ inputs.layout }}
18+
name: WPT ${{ inputs.layout }}
1919
runs-on: ubuntu-20.04
2020
env:
2121
max_chunk_id: 20
@@ -90,7 +90,7 @@ jobs:
9090
wpt-jsonsummary.${{ matrix.chunk_id }}.log
9191
9292
report-test-results:
93-
name: Reporting test results
93+
name: Report WPT Results
9494
runs-on: ubuntu-latest
9595
if: ${{ always() && !cancelled() && (github.ref_name == 'try-wpt' || github.ref_name == 'try-wpt-2020' || inputs.wpt == 'test') }}
9696
needs:

.github/workflows/linux.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux workflow
1+
name: Linux
22
on:
33
workflow_call:
44
inputs:
@@ -29,7 +29,7 @@ on:
2929
layout:
3030
required: false
3131
type: choice
32-
options: ["2013", "2020", "all"]
32+
options: ["none", "2013", "2020", "all"]
3333
unit-tests:
3434
required: false
3535
default: false
@@ -50,7 +50,7 @@ env:
5050
CARGO_INCREMENTAL: 0
5151

5252
jobs:
53-
build-linux:
53+
build:
5454
name: Build
5555
runs-on: ubuntu-20.04
5656
steps:
@@ -113,33 +113,33 @@ jobs:
113113
name: release-binary
114114
path: target.tar.gz
115115

116-
linux-wpt-2020:
116+
wpt-2020:
117117
if: ${{ github.ref_name == 'try-wpt-2020' || inputs.layout == '2020' || inputs.layout == 'all' }}
118118
name: Linux WPT Tests 2020
119-
needs: ["build-linux"]
119+
needs: ["build"]
120120
uses: ./.github/workflows/linux-wpt.yml
121121
with:
122122
wpt: ${{ inputs.wpt }}
123123
layout: "layout-2020"
124124

125-
linux-wpt-2013:
125+
wpt-2013:
126126
if: ${{ github.ref_name == 'try-wpt' || inputs.layout == '2013' || inputs.layout == 'all' }}
127127
name: Linux WPT Tests 2013
128-
needs: ["build-linux"]
128+
needs: ["build"]
129129
uses: ./.github/workflows/linux-wpt.yml
130130
with:
131131
wpt: ${{ inputs.wpt }}
132132
layout: "layout-2013"
133133

134-
build_result:
135-
name: homu build finished
134+
result:
135+
name: Result
136136
runs-on: ubuntu-latest
137137
if: always()
138138
# needs all build to detect cancellation
139139
needs:
140-
- "build-linux"
141-
- "linux-wpt-2020"
142-
- "linux-wpt-2013"
140+
- "build"
141+
- "wpt-2020"
142+
- "wpt-2013"
143143

144144
steps:
145145
- name: Mark the job as successful
@@ -148,3 +148,4 @@ jobs:
148148
- name: Mark the job as unsuccessful
149149
run: exit 1
150150
if: contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled')
151+

.github/workflows/mac.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Mac workflow
1+
name: Mac
22

33
on:
44
workflow_call:
@@ -36,7 +36,7 @@ env:
3636
CARGO_INCREMENTAL: 0
3737

3838
jobs:
39-
build-mac:
39+
build:
4040
name: Build
4141
runs-on: macos-12
4242
steps:
@@ -143,13 +143,13 @@ jobs:
143143
# test-wpt.${{ matrix.chunk_id }}.log
144144
# filtered-wpt-summary.${{ matrix.chunk_id }}.log
145145

146-
build_result:
147-
name: homu build finished
146+
result:
147+
name: Result
148148
runs-on: ubuntu-latest
149149
if: always()
150150
# needs all build to detect cancellation
151151
needs:
152-
- "build-mac"
152+
- "build"
153153

154154
steps:
155155
- name: Mark the job as successful

.github/workflows/main.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
name: Merge queue and try
1+
name: Main
22

33
on:
44
push:
5-
branches: ["auto", "try"]
6-
7-
# Used by GH merge queue for landing PRs
5+
# Run the entire pipeline for 'master' even though the merge queue already runs checks
6+
# for every change. This just offers an extra layer of testing and covers the case of
7+
# random force pushes.
8+
branches: ["master", "try"]
9+
pull_request:
10+
types: ['opened', 'synchronize']
11+
branches: ["**"]
812
merge_group:
913
types: [checks_requested]
10-
11-
# Allows you to run this workflow manually from the Actions tab
1214
workflow_dispatch:
1315

1416
jobs:
1517
decision:
16-
name: Decision job
18+
name: Decision
1719
runs-on: ubuntu-20.04
1820
steps:
19-
- name: Previous successful build check
21+
# If an identical build exists that suceeded, skip this workflow run. We don't do
22+
# this check for pull_request and merge_group events, out of caution.
23+
- name: Skip previous identical builds
24+
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
2025
uses: actions/github-script@v6
2126
with:
2227
script: |
@@ -35,13 +40,15 @@ jobs:
3540
3641
build-win:
3742
name: Windows
43+
if: ${{ github.event_name == 'push' || github.event_name == 'merge_group' }}
3844
needs: ["decision"]
3945
uses: ./.github/workflows/windows.yml
4046
with:
4147
unit-tests: true
4248

4349
build-mac:
4450
name: Mac
51+
if: ${{ github.event_name == 'push' || github.event_name == 'merge_group' }}
4552
needs: ["decision"]
4653
uses: ./.github/workflows/mac.yml
4754
with:
@@ -53,11 +60,11 @@ jobs:
5360
uses: ./.github/workflows/linux.yml
5461
with:
5562
wpt: 'test'
56-
layout: 'all'
57-
unit-tests: true
63+
layout: ${{ (github.event_name == 'push' || github.event_name == 'merge_group') && 'all' || 'none' }}
64+
unit-tests: ${{ github.event_name == 'push' || github.event_name == 'merge_group' }}
5865

5966
build_result:
60-
name: homu build finished
67+
name: Result
6168
runs-on: ubuntu-latest
6269
if: always()
6370
# needs all build to detect cancellation

.github/workflows/pull-request.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/windows.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows workflow
1+
name: Windows
22

33
on:
44
workflow_call:
@@ -34,7 +34,7 @@ env:
3434
CARGO_TARGET_DIR: C:\\a\\servo\\servo\\target
3535

3636
jobs:
37-
build-win:
37+
build:
3838
name: Build
3939
runs-on: windows-2019
4040
steps:
@@ -73,7 +73,7 @@ jobs:
7373
path: C:\\a\\servo\\servo\\target\\cargo-timings-*
7474
- name: Package
7575
run: python mach package --release
76-
- name: Upload Package
76+
- name: Upload package
7777
uses: actions/upload-artifact@v3
7878
with:
7979
name: win
@@ -82,7 +82,7 @@ jobs:
8282
# Bundle: C:\a\servo\servo\target\release\msi\Servo.exe
8383
# Zip: C:\a\servo\servo\target\release\msi\Servo.zip
8484
path: C:\\a\\servo\\servo\\target/release/msi/Servo.exe
85-
- name: Upload
85+
- name: Upload nightly
8686
if: ${{ inputs.upload }}
8787
run: |
8888
python mach upload-nightly windows-msvc --secret-from-environment `
@@ -92,13 +92,13 @@ jobs:
9292
NIGHTLY_REPO_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
9393
NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
9494

95-
build_result:
96-
name: homu build finished
95+
result:
96+
name: Result
9797
runs-on: ubuntu-latest
9898
if: always()
9999
# needs all build to detect cancellation
100100
needs:
101-
- "build-win"
101+
- "build"
102102

103103
steps:
104104
- name: Mark the job as successful
@@ -107,3 +107,4 @@ jobs:
107107
- name: Mark the job as unsuccessful
108108
run: exit 1
109109
if: contains(join(needs.*.result, ','), 'failure') || contains(join(needs.*.result, ','), 'cancelled')
110+

python/tidy/tidy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _default_walk(self):
153153
yield os.path.join(root, f)
154154

155155
def _git_changed_files(self):
156-
args = ["git", "log", "-n1", "--merges", "--format=%H"]
156+
args = ["git", "log", "-n1", "--committer", "noreply@github.com", "--format=%H"]
157157
last_merge = subprocess.check_output(args, universal_newlines=True).strip()
158158
if not last_merge:
159159
return

python/wpt/run.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,17 @@ def get_github_context_information() -> GithubContextInformation:
223223
run_id = github_context['run_id']
224224
build_url = f"{repo_url}/actions/runs/{run_id}"
225225

226-
commit_title = github_context["event"]["head_commit"]["message"]
227-
match = re.match(r"^Auto merge of #(\d+)", commit_title)
228-
pr_url = f"{repo_url}/pull/{match.group(1)}" if match else None
226+
commit_title = "<no title>"
227+
if "merge_group" in github_context["event"]:
228+
commit_title = github_context["event"]["merge_group"]["head_commit"]["message"]
229+
if "head_commit" in github_context["event"]:
230+
commit_title = github_context["event"]["head_commit"]["message"]
231+
232+
pr_url = None
233+
match = re.match(r"^Auto merge of #(\d+)", commit_title) or \
234+
re.match(r"\(#(\d+)\)", commit_title)
235+
if match:
236+
pr_url = f"{repo_url}/pull/{match.group(1)}" if match else None
229237

230238
return GithubContextInformation(
231239
build_url,

0 commit comments

Comments
 (0)