Skip to content

ci(github-actions): consolidate 3 workflows into single lint.yml with 3 jobs - #159

Merged
wei18 merged 2 commits into
mainfrom
ci/consolidate-lint-workflows
May 26, 2026
Merged

wei18 merged 2 commits into
mainfrom
ci/consolidate-lint-workflows

Conversation

@wei18

@wei18 wei18 commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

Per user 2026-05-26 request:

Why consolidate

  • Simpler required-status-check setup when branch protection lands (one workflow name, three job names — vs three workflow names previously)
  • `gh api` replaces `git diff` for changed-file enumeration → no `fetch-depth: 0` needed → faster checkout, smaller runner workspace, single canonical source

Job layout

Job Runner Purpose
`pr-metadata` ubuntu Conventional Commits PR title (`amannn/action-semantic-pull-request@v5`)
`docs-link-check` ubuntu Lychee on changed `.md` files only (skip if none)
`swift-lint` macos SwiftLint strict + SwiftFormat hard-fail on changed `.swift` files only

All 3 use `gh api repos/.../pulls//files` to enumerate changed files; empty list → skip with log line.

NOT in this PR (#1 deferred)

  • `docs-link-check` apple.com 403 fix — wait until first run of consolidated workflow surfaces the actual failing URLs, then add `.lycheeignore` in a tiny follow-up

Test plan

  • First PR triggering this workflow — all 3 jobs run; pr-metadata + swift-lint should green
  • If docs-link-check fails on apple.com etc. → follow-up `.lycheeignore`

🤖 Generated with Claude Code

wei18 and others added 2 commits May 26, 2026 17:19
… 3 jobs

Per user request 2026-05-26:
- Merge pr-metadata.yml + docs-link-check.yml + lint.yml → single
  lint.yml with 3 sibling jobs (pr-metadata / docs-link-check /
  swift-lint). Simpler required-status-check setup when branch
  protection lands (one workflow name, three job names).

Key changes vs prior 3-file setup:
- pr-metadata job: ubuntu-latest (was already; no change)
- docs-link-check job: ubuntu-latest; gh api fetches changed
  markdown files (per user: drop fetch-depth: 0)
- swift-lint job: macos-latest (toolchain requirement);
  gh api replaces `git diff --diff-filter` (per user: drop
  fetch-depth: 0); strict swiftlint + hard-fail swiftformat
  preserved

All 3 jobs now use `gh api repos/.../pulls/<num>/files` to enumerate
changed files instead of `git diff` against the base ref. Benefits:
- Faster checkout (no full history)
- Smaller runner workspace
- Single canonical source of changed-file list (the PR API)
- No risk of merge-base resolution edge cases

Workflow-level path filter removed so the consolidated workflow always
runs; per-job logic decides what to do based on changed-files list
(empty → skip with explanatory log line).

Closes user 2026-05-26 requests:
- #2 pr-metadata: linux + drop fetch-depth + use gh api ✓
- #3 consolidate to single lint.yml with 3 jobs ✓
- #1 docs-link-check failure (apple.com 403?): NOT addressed in this PR
  — will need .lycheeignore follow-up after first run shows actual
  failing URLs

Co-Authored-By: Claude Opus 4.7 <[email protected]>
… 2026-05-26)

Per user decision 2026-05-26:
- swiftlint coverage sufficient; swiftformat is redundant + double-tool
  maintenance cost not justified
- swift-lint job runner: macos-latest → ubuntu-latest (swiftlint has linux
  x86_64 binary via mise; no Swift toolchain needed for lint-only)

### Removed
- `.swiftformat` (config file, deleted)
- `.mise.toml` swiftformat pin
- `lefthook.yml` swiftformat hook
- `.github/workflows/lint.yml` SwiftFormat lint step
- `docs/foundations.md §7.5.1` option-b doc (strikethrough + obsolete note;
  historical impl-notes preserved at meetings/2026-05-26_swiftformat-option-b.impl-notes.md)
- `docs/foundations.md §Backlog` "swiftformat 加入 lefthook" entry
  (strikethrough + CANCELLED tag)

### Updated foundations §4 Phase 1 GH Actions description
- Reflects consolidated lint.yml (3 jobs in one workflow)
- Reflects swift-lint on ubuntu + swiftformat removal
- Cross-refs issues #156 #157 #158 for Phase 2/3 follow-ups

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@wei18
wei18 force-pushed the ci/consolidate-lint-workflows branch from 4fddf13 to 43b6f92 Compare May 26, 2026 09:31
@wei18
wei18 merged commit b72517d into main May 26, 2026
2 of 3 checks passed
@wei18
wei18 deleted the ci/consolidate-lint-workflows branch May 26, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant