Skip to content

Commit c1af663

Browse files
ci: one check job per pull request on the shared workflow (#51)
Replaces the separate conflict, commitlint and build jobs with one `checks` job from the shared reusable CI workflow. - A pull request runs `pnpm check:static` in one job; a Mergify queue draft and a push to main run `pnpm check:ci`. - The squash-message lint is a step of that job, not its own workflow. Docs-only pull requests skip Nix and still lint the message. - A newer push to a pull request cancels its older run. - Mergify now requires `checks / check`; the old check names are removed from its queue rules. The repository ruleset's required check is renamed to match after this merges. - The Nix cache push also pushes `pnpm-store` and `producer-tarballs`, which the dev shell otherwise builds on every cold runner. Co-authored-by: systemfsoftware-bot <318394648+systemfsoftware-bot@users.noreply.github.com>
1 parent a414bbe commit c1af663

4 files changed

Lines changed: 31 additions & 86 deletions

File tree

‎.github/workflows/check.yml‎

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

‎.github/workflows/ci.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
# One job per pull request. A pull request runs format, lint and typecheck on the affected packages. A Mergify queue draft (head ref
4+
# `mergify/merge-queue/*`) and a push to main run the full command. Mergify builds its drafts as pull requests, so
5+
# there is no merge_group trigger. The squash-message lint and the change-intent check are steps of the same job.
6+
# A newer push to a pull request cancels its older run.
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
checks:
18+
uses: systemfsoftware/systemfsoftware/.github/workflows/reusable-ci.yml@f271b208fd10c56d27380de6bc43f54b9c7ee2a5
19+
with:
20+
commitlint: true
21+
changeset: true
22+
install: |
23+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
24+
mkdir -p .cache
25+
pnpm bootstrap
26+
fast: export TURBO_SCM_BASE="$BASE" TURBO_SCM_HEAD="$HEAD" && pnpm exec turbo run format:check lint typecheck --affected
27+
full: pnpm exec turbo run format:check lint typecheck test

‎.github/workflows/commitlint.yml‎

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

‎.mergify.yml‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,13 @@ queue_rules:
66
queue_conditions:
77
- 'commits[*].commit_message ~= (?ms)\A(?=.*^git-subtree-dir: \S+$)(?=.*^git-subtree-split: [0-9a-f]{40}$)'
88
- -linear-history
9-
- check-success = check
10-
- or:
11-
- check-success = commitlint / lint PR commits
12-
- and:
13-
- author = dependabot[bot]
14-
- check-skipped = commitlint / lint PR commits
9+
- check-success = checks / check
1510
merge_conditions:
16-
- check-success = check
11+
- check-success = checks / check
1712
- name: default
1813
# Checked on the PR itself before it enters the queue.
1914
queue_conditions:
20-
- check-success = check
21-
- or:
22-
- check-success = commitlint / lint PR commits
23-
- and:
24-
- author = dependabot[bot]
25-
- check-skipped = commitlint / lint PR commits
15+
- check-success = checks / check
2616
- '-commits[*].commit_message ~= (?m)^git-subtree-dir: \S+$'
2717
- not:
2818
and:
@@ -35,4 +25,4 @@ queue_rules:
3525
- -modified-files ~= ^(repos/constitution|repos/worktrunk-scripts)/
3626
# Checked on Mergify's queue draft PR (mergify/merge-queue/*), i.e. CI on the PR rebased with main and any batch.
3727
merge_conditions:
38-
- check-success = check
28+
- check-success = checks / check

0 commit comments

Comments
 (0)