Skip to content

Commit f0b0954

Browse files
committed
ci: init pr.yml and merge-queue.yml workflows
These workflows will serve as top-level entry points for running GHA jobs against PRs and merge groups in the merge queue. Currently, the only required job is `lint`, which runs treefmt.
1 parent 94386cd commit f0b0954

File tree

3 files changed

+63
-7
lines changed

3 files changed

+63
-7
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: lint
22

33
on:
4-
pull_request:
5-
paths-ignore:
6-
- "**.md"
7-
- "**.svg"
8-
- ".gitignore"
9-
- "LICENSE"
10-
- "flake.lock"
4+
workflow_call:
115

126
jobs:
137
treefmt:

.github/workflows/merge-queue.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Merge Queue
2+
3+
on:
4+
merge_group:
5+
6+
permissions: {}
7+
8+
jobs:
9+
lint:
10+
uses: ./.github/workflows/lint.yml
11+
12+
# This job's only purpose is to serve as a target for the "Required Status Checks" branch ruleset.
13+
# It "needs" all the jobs that should block the Merge Queue.
14+
# If they pass, it is skipped — which counts as "success" for purposes of the branch ruleset.
15+
# However, if any of them fail, this job will also fail — thus blocking the branch ruleset.
16+
no-pr-failures:
17+
# Modify this list to add or remove jobs from required status checks.
18+
needs:
19+
- lint
20+
21+
# WARNING:
22+
# Do NOT change the name of this job, otherwise the rule will not catch it anymore.
23+
# This would prevent all PRs from passing the merge queue.
24+
name: no PR failures
25+
# The "cancelled()" function only checks the whole workflow, but not individual jobs.
26+
if: ${{ failure() || contains(needs.*.result, 'cancelled') }}
27+
runs-on: ubuntu-24.04-arm
28+
steps:
29+
- run: exit 1

.github/workflows/pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: pr-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
8+
cancel-in-progress: true
9+
10+
permissions: {}
11+
12+
jobs:
13+
lint:
14+
uses: ./.github/workflows/lint.yml
15+
16+
# This job's only purpose is to serve as a target for the "Required Status Checks" branch ruleset.
17+
# It "needs" all the jobs that should block merging a PR.
18+
# If they pass, it is skipped — which counts as "success" for purposes of the branch ruleset.
19+
# However, if any of them fail, this job will also fail — thus blocking the branch ruleset.
20+
no-pr-failures:
21+
# Modify this list to add or remove jobs from required status checks.
22+
needs:
23+
- lint
24+
25+
# WARNING:
26+
# Do NOT change the name of this job, otherwise the rule will not catch it anymore.
27+
# This would prevent all PRs from merging.
28+
name: no PR failures
29+
# The "cancelled()" function only checks the whole workflow, but not individual jobs.
30+
if: ${{ failure() || contains(needs.*.result, 'cancelled') }}
31+
runs-on: ubuntu-24.04-arm
32+
steps:
33+
- run: exit 1

0 commit comments

Comments
 (0)