Skip to content

Commit 11de3d7

Browse files
authored
ci: run the checks for merge queue groups (#176)
The merge queue tests each pull request on top of the latest main before it lands. Verify is the required check, so CI must also run on merge_group events, or a queued pull request would wait forever. A merge group is scoped like a pull request, against the group's base commit, and like a pull request it only reads the caches and skips the nightly-only DuckShop and fuzz jobs.
1 parent aa5ab22 commit 11de3d7

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ name: CI
99
# The nightly run on main replays every case, refreshes the replay cache pull requests reuse,
1010
# converts DuckShop within its time budget and fuzzes. Release Please dispatches a full run on
1111
# each release pull request's branch, so every release replays every case first.
12+
# A merge queue group runs the same checks as a pull request, scoped against the group's base.
1213
on:
1314
pull_request:
15+
merge_group:
1416
schedule:
1517
- cron: "17 3 * * *"
1618
workflow_dispatch:
@@ -49,9 +51,9 @@ jobs:
4951
id: scope
5052
env:
5153
EVENT_NAME: ${{ github.event_name }}
52-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
54+
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
5355
run: |
54-
if [[ "${EVENT_NAME}" == "pull_request" ]]; then
56+
if [[ "${EVENT_NAME}" == "pull_request" || "${EVENT_NAME}" == "merge_group" ]]; then
5557
python3 -m scripts.select_replay scope --base "${BASE_SHA}" >> "${GITHUB_OUTPUT}"
5658
else
5759
printf 'replay=full\ncode=true\nsite=true\n' >> "${GITHUB_OUTPUT}"
@@ -76,7 +78,7 @@ jobs:
7678
# `uv run` would otherwise sync the default groups, recorder included.
7779
UV_NO_SYNC: "1"
7880
# The evidence pin check and the result baselines compare with the pull request's base.
79-
EVIDENCE_BASE: ${{ github.event.pull_request.base.sha || 'origin/main' }}
81+
EVIDENCE_BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/main' }}
8082
REPLAY: ${{ needs.changes.outputs.replay }}
8183
steps:
8284
- uses: actions/checkout@v4
@@ -96,7 +98,7 @@ jobs:
9698
- uses: Swatinem/rust-cache@v2
9799
with:
98100
shared-key: gate
99-
save-if: ${{ github.event_name != 'pull_request' }}
101+
save-if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
100102
- name: Download the DuckDB library again if the restored cache lacks it
101103
run: scripts/refetch_duckdb_library.sh
102104
# The evidence snapshot evidence.toml pins; scripts/evidence.sh verifies it after a restore.
@@ -134,7 +136,7 @@ jobs:
134136
run: echo "No changed file is in a crate the sqlquack binary is built from, so nothing replays."
135137
# Pull requests restore the cache saved on their base branch, main's from the nightly run.
136138
- name: Save the replay cache
137-
if: env.REPLAY != 'none' && github.event_name != 'pull_request'
139+
if: env.REPLAY != 'none' && github.event_name != 'pull_request' && github.event_name != 'merge_group'
138140
uses: actions/cache/save@v4
139141
with:
140142
path: target/replay-cache.json
@@ -171,7 +173,7 @@ jobs:
171173
172174
duckshop:
173175
name: Convert DuckShop within the time budget
174-
if: github.event_name != 'pull_request'
176+
if: github.event_name != 'pull_request' && github.event_name != 'merge_group'
175177
runs-on: ubuntu-24.04
176178
timeout-minutes: 30
177179
steps:
@@ -184,7 +186,7 @@ jobs:
184186
- uses: Swatinem/rust-cache@v2
185187
with:
186188
shared-key: duckshop
187-
save-if: ${{ github.event_name != 'pull_request' }}
189+
save-if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
188190
- name: Download the DuckDB library again if the restored cache lacks it
189191
run: scripts/refetch_duckdb_library.sh
190192
- name: Compile DuckShop and DuckShop 10K
@@ -194,7 +196,7 @@ jobs:
194196

195197
fuzz:
196198
name: Fuzz tolerant parsing
197-
if: github.event_name != 'pull_request'
199+
if: github.event_name != 'pull_request' && github.event_name != 'merge_group'
198200
runs-on: ubuntu-24.04
199201
timeout-minutes: 15
200202
env:

0 commit comments

Comments
 (0)