Skip to content

feat(#519): add reusable Swift CI golden-path pipeline#520

Merged
atlas-apex merged 1 commit into
devfrom
feature/GH-519-swift-golden-path
Jun 6, 2026
Merged

feat(#519): add reusable Swift CI golden-path pipeline#520
atlas-apex merged 1 commit into
devfrom
feature/GH-519-swift-golden-path

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the first Swift golden-path pipelinegolden-paths/pipelines/swift-ci.yml. Until now every template under golden-paths/pipelines/ assumed Node/TypeScript (setup-node, npm ci, ubuntu-latest); a Swift/macOS adopter had nothing to copy and had to author CI from scratch. This closes that gap.
  • Guarded test step is the reusable idea — the workflow greps Package.swift for a test target and runs swift test only when one exists, else prints a skip note. So the pipeline is green on a package that has no tests yet and upgrades itself to run tests the moment a test target is added — no edit to the template needed. That makes it a safe drop-in during adoption, which is exactly when a test suite usually doesn't exist yet.
  • Matches the macOS release toolchainmacos-latest + maxim-lobanov/setup-xcode@latest-stable, least-privilege permissions: contents: read, and concurrency cancel-in-progress to avoid piling up redundant runs on the macOS runner pool.
  • Documented in both indexes — added to the golden-paths/pipelines/README.md "Available Pipelines" table and the CLAUDE.md CI/CD pipelines table, so it's discoverable the same way the other pipelines are.

Testing

  1. actionlint golden-paths/pipelines/swift-ci.yml → exit 0.
  2. YAML parses clean (python3 -c "import yaml; yaml.safe_load(...)").
  3. The same workflow shape was instantiated into a real Swift SPM macOS app and swift build verified green locally on Swift 6.3.2; the guard correctly takes the skip branch when no test target is present.
  4. markdownlint clean on the two changed .md files.

Closes #519


Glossary

Term Definition
Golden-path pipeline A reusable GitHub Actions workflow under golden-paths/pipelines/ that adopters copy into a project's .github/workflows/.
Swift Package Manager (SPM) Swift's built-in build/test tool, driven by a Package.swift manifest (swift build / swift test).
Guarded test step A CI step that runs swift test only when a test target exists, keeping the pipeline valid before any tests are written.
setup-xcode (maxim-lobanov) A GitHub Action that selects the Xcode — and therefore Swift — toolchain on macOS runners.
Concurrency / cancel-in-progress GitHub Actions feature that cancels an older run of the same group (keyed on the git ref) when a newer one starts.

- New golden-paths/pipelines/swift-ci.yml: macos-latest + setup-xcode,
  swift build on PR/push, guarded swift test (runs only when a test target
  exists in Package.swift), concurrency cancel-in-progress, least-privilege perms
- List it in golden-paths/pipelines/README.md and the CLAUDE.md CI table
- Fills the gap where all golden-path pipelines were Node/TS on ubuntu-latest;
  Swift/macOS adopters had no template to copy

Closes #519

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

<!-- pre-push: skip -->

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #520

Commit: 432f2bf74921e5dcb9dbb20d7a98ae27509a6dc9

Summary

Adds the first non-Node golden-path CI template — golden-paths/pipelines/swift-ci.yml — a Swift Package Manager build gate on macos-latest with a guarded swift test step that no-ops cleanly until a test target exists. Registers it in both discovery indexes (golden-paths/pipelines/README.md and CLAUDE.md). Documentation/template contribution only — no application code, no test suite to run.

Checklist Results

  • Architecture & Design: Pass — workflow is least-privilege (permissions: contents: read), uses concurrency + cancel-in-progress correctly, and the guarded-test pattern is a sound reusable idea.
  • Code Quality: Pass — grep -qE '\.testTarget|testTarget\(' Package.swift guard is correct; pinned actions/checkout@v4 and maxim-lobanov/setup-xcode@v1.
  • Testing: N/A — golden-path templates are validated by actionlint (passed locally) + instantiation, not by a unit suite in this repo.
  • Security: Pass — least-privilege token scope, no secrets, no untrusted input interpolation.
  • Performance: Pass — cancel-in-progress avoids piling redundant runs on the macOS runner pool.
  • PR Description & Glossary: Pass — five-term glossary present; Testing section concrete; ticket linked (Closes #519).
  • Summary Bullet Narrative: Pass — every bullet states what changed AND why it matters; no label-only bullets.
  • Technical Decisions (AgDR):N/A — golden-paths/pipelines/ is not an AgDR trigger path; rationale recorded upstream in #519.
  • Adopter Handbooks: N/A — only architecture/ + general/ handbooks always-load; none have triggers relevant to a CI YAML + doc-table diff. migration-safety.md (blocking) does not apply (no migration files touched).

Issues Found

None.

Suggestions

  • nit (non-blocking): the push trigger is pinned to branches: [main] while the README table describes it as "push to default branch". The inline comment already tells adopters to adjust for master, so this is purely a wording nuance, not a defect.
  • nit (non-blocking): the PR body prose writes setup-xcode@latest-stable as shorthand; the YAML correctly pins the action to @v1 with xcode-version: latest-stable. The deliverable is correct — just flagging the prose shorthand.

Verdict

APPROVED (posted as a comment — GitHub blocks self-approval; the approval marker has been written for the merge gate.)


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 432f2bf74921e5dcb9dbb20d7a98ae27509a6dc9

@atlas-apex atlas-apex merged commit b4ba5ab into dev Jun 6, 2026
3 checks passed
@atlas-apex atlas-apex deleted the feature/GH-519-swift-golden-path branch June 6, 2026 10:17
@atlas-apex atlas-apex mentioned this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants