Skip to content

Restore Swift 6.1 Windows, remove wasm excludes, disable fail-fast on Ubuntu#135

Closed
leogdion wants to merge 18 commits intov0.0.4from
workflow-matrix-updates
Closed

Restore Swift 6.1 Windows, remove wasm excludes, disable fail-fast on Ubuntu#135
leogdion wants to merge 18 commits intov0.0.4from
workflow-matrix-updates

Conversation

@leogdion
Copy link
Copy Markdown
Member

@leogdion leogdion commented Apr 2, 2026

Summary

  • Add Swift 6.1 back to Windows build matrix
  • Remove all wasm/wasm-embedded excludes from Ubuntu build matrix
  • Add fail-fast: false to Ubuntu build job

🤖 Generated with Claude Code


Perform an AI-assisted review on CodePeer.com

leogdion and others added 18 commits April 2, 2026 12:11
#128)

- Add concurrency groups to cancel in-progress runs on same branch
- Add paths-ignore to skip CI on doc-only changes
- Add pull_request trigger for PRs to main
- Add configure job with dynamic matrix (minimal on feature branches, full on main/PRs)
- Gate Windows builds to full matrix only
- Split macOS into core (always) and full (main/PRs only) jobs
- Update lint/docs conditions to run when optional jobs are skipped
- Update all GitHub Actions to latest versions (checkout v6, cache v5, codecov v6, etc.)
- Add cache cleanup workflows for deleted branches and closed PRs
- Update CodeQL workflow action versions

Closes #128, closes #126, closes #127

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Ubuntu matrix: add Swift 6.2 and 6.3, remove nightly versions; use 6.3 as single-version for feature branches
- build-macos: keep SPM-only; move macOS Build to build-macos-full
- build-macos-full: add macOS Build with Xcode 26.4; update iOS/watchOS/tvOS/visionOS to Xcode 26.4 / osVersion 26.4
- Add build-android and build-wasm jobs (full-matrix only)
- Update lint and docs needs to include new jobs
- codeql.yml: update runner to macos-26, Xcode to 26.4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- configure outputs separate ubuntu-os/swift/type arrays (matching MonthBar pattern)
- build-ubuntu composes matrix from all three outputs; wasm/wasm-embedded types
  use swift:6.3-noble container; type and wasmtime-version: 41.0.3 passed to swift-build
- Remove separate build-wasm job
- Android: add swift 6.3 alongside 6.2, add free-disk-space step,
  android-swift-version/android-api-level/android-run-tests parameters, coverage upload

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- configure: guard ci-skip check with event_name check so it always runs on
  pull_request events (github.event.head_commit is null on PRs)
- build-macos: add needs: [configure], gate on configure success so ci-skip
  propagates via dependency chain instead of re-checking head_commit.message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The swift:6.3 Docker image does not include curl, which is required by
the Codecov uploader. Applies to all 6.3 builds including wasm types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add version branch pattern to pull_request trigger so PRs targeting
  v0.0.4 (and similar) fire the full matrix CI
- Use github.head_ref || github.ref_name for concurrency group so push
  and pull_request events for the same branch share a group; PR run
  (arrives second) cancels the concurrent push run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Settings.projectRoot now uses a 3-strategy fallback matching the SyndiKit
pattern: working directory first (reliable for WASM/Android/SPM), then
#filePath-relative (macOS/Linux CI), then walking up parent directories.

Add android-copy-files to copy Documentation.docc to the Android emulator's
working directory so the path resolution finds the files via Strategy 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Examples/ (2.1MB) and full Documentation.docc (with images) exceed WASM
memory constraints. On WASI, use only the two lightweight tutorial .md files
(~36KB total). Matches SyndiKit's #if os(WASI) subset pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Strategy 1b to Settings.projectRoot: detect Documentation.docc/ in
  working dir (android-copy-files copies last component only)
- Add #if os(Android) branch to docPaths with prefix-less paths matching
  the flat copy layout on Android devices
- Add id: build to swift-build steps and gate coverage upload/processing
  on steps.build.outputs.contains-code-coverage == 'true' across all jobs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.4.6 adds .gitattributes for symlinks on Windows, fixing build failures
where symlinked plugin source files were checked out as plain text, causing
'cannot find Lock in scope' and related errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On Android, Documentation.docc is copied flat to the working directory
without the Sources/SyntaxKit/ prefix. Centralize the prefix logic in
resolveFilePath so test methods use short paths and Settings adds the
prefix for non-Android platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix Windows matrix to use proper cross-product (runs-on × swift) instead of mismatched include entries
- Fix lint/docs if conditions to guard against null head_commit on PR events
- Fix cache cleanup to skip tag deletions (only process branch deletes)
- Add cancellation guard to build-macos-full
- Remove hardcoded swift:6.3-noble container for WASM builds; use matrix version
- Add paths-ignore to CodeQL to skip doc-only commits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
swift-docc-plugin 1.4.6 is incompatible with Swift 6.1 on Windows (missing
Lock, SnippetExtractor, ParsedSymbolGraphArguments types). Windows matrix
now covers 6.2 and 6.3 only.

WASM/wasm-embedded tooling does not support Swift 6.0 or 6.1 on Ubuntu,
so those combinations are excluded from the build matrix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
swift-docc-plugin 1.4.6 added .gitattributes to mark symlink files, but
git on Windows also needs core.symlinks=true to create real symlinks rather
than plain-text stubs. Without it, SPM checks out the plugin's shared
source files as text, causing 'cannot find Lock in scope' and related errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Ubuntu

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f470bb38-c5de-49f9-b8fb-c7c66d9195f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch workflow-matrix-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.35%. Comparing base (18c1e25) to head (f442e81).
⚠️ Report is 1 commits behind head on v0.0.4.

Additional details and impacted files
@@            Coverage Diff             @@
##           v0.0.4     #135      +/-   ##
==========================================
+ Coverage   78.16%   78.35%   +0.19%     
==========================================
  Files         126      126              
  Lines        5651     4555    -1096     
==========================================
- Hits         4417     3569     -848     
+ Misses       1234      986     -248     
Flag Coverage Δ
spm 77.84% <ø> (+0.28%) ⬆️
swift- ?
swift-6.0 78.02% <ø> (?)
swift-6.1 78.19% <ø> (?)
swift-6.2 77.84% <ø> (?)
swift-6.3 77.87% <ø> (?)
ubuntu 78.35% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claude
Copy link
Copy Markdown

claude bot commented Apr 2, 2026

PR Review

This PR restores Swift 6.1 to Windows, removes wasm/wasm-embedded excludes from Ubuntu, disables fail-fast on Ubuntu, and includes a comprehensive set of CI improvements. Overall the work is solid. Here are my observations:

Bugs / Potential Failures

1. Ubuntu wasm matrix has no version exclusions - may fail for Swift 6.0/6.1/6.2

The configure job emits all four Swift versions (6.0-6.3) combined with all three build types for the full matrix. Earlier commits in this branch explicitly added exclusions for Swift older than 6.3 with the message "wasm/wasm-embedded tooling does not support Swift 6.0 or 6.1". The final commit reverses this. If swift-build@v1.5.2 does not silently skip unsupported combinations, the Ubuntu matrix will have failing jobs for wasm + older Swift versions. Recommend confirming the action handles this gracefully, or re-adding exclusion logic in the configure step.

2. Windows Swift 6.1 may still be incompatible with swift-docc-plugin 1.4.6

Commit b9aaf24 explicitly dropped 6.1 from Windows: "swift-docc-plugin 1.4.6 is incompatible with Swift 6.1 on Windows (missing Lock, SnippetExtractor, ParsedSymbolGraphArguments types)". The final commit adds it back, relying on the git config --global core.symlinks true fix. The symlinks fix addresses checkout behaviour, but if the incompatibility is at build time in the plugin source, symlinks alone won't resolve it. Worth a quick validation run before merging.

Code Quality

3. checkout is unnecessary in cache cleanup workflows

Both cleanup-caches.yml and cleanup-pr-caches.yml include uses: actions/checkout@v6 but never use the checked-out repository - they only call the GitHub REST API via github-script. Removing the checkout step reduces job startup time.

4. Hardcoded Xcode_26.4.app in CodeQL workflow is fragile

codeql.yml hardcodes /Applications/Xcode_26.4.app. If the macos-26 runner ships a different Xcode version (common as beta runners update), CodeQL scans will break. Consider verifying the path exists first or aligning with how build-macos selects Xcode.

5. nightly field in Ubuntu container expression is now dead code

The build-ubuntu container expression still references matrix.swift.nightly, but the configure job no longer outputs any nightly field so the nightly container branch is permanently unreachable. Harmless but confusing - remove it or add a comment.

6. lint and docs jobs blocked on build-android failures

Both downstream jobs now needs: [build-ubuntu, build-macos, build-windows, build-macos-full, build-android] with !failure(). If build-android fails (a new, complex job), linting and documentation validation are silently skipped, masking unrelated code quality issues. Consider keeping lint/docs independent of the Android job since it is a new, experimental target.

7. CodeQL build step comment is misleading

The inline echo "Run, Build Application using script" says "using script" but runs swift build directly. Suggest adding a proper name: field and dropping the misleading echo.

Positives

  • Dynamic matrix (minimal on feature branches, full on main/PRs) is a clean, well-structured optimisation.
  • Concurrency groups using github.head_ref || github.ref_name correctly deduplicates push+PR runs for the same branch.
  • Coverage upload guards (steps.build.outputs.contains-code-coverage == 'true') prevent spurious failures on platforms that do not emit coverage.
  • Cache cleanup workflows are a useful maintenance addition - the ref_type !== 'branch' guard in cleanup-caches.yml correctly skips tag deletions.
  • Settings.swift 3-strategy path resolution is a robust pattern for cross-platform test execution.
  • Updating all action versions (checkout@v6, cache@v5, codecov@v6) in one pass is good hygiene.

Summary: Items 1 and 2 are the highest-risk issues and could produce CI failures immediately after merge. Items 3-7 are quality improvements worth addressing. The overall direction is good.

Generated with Claude Code

@claude
Copy link
Copy Markdown

claude bot commented Apr 3, 2026

Code Review

Summary

PR #135 makes substantial CI/CD improvements: restoring Swift 6.1 Windows builds, removing WASM excludes from Ubuntu, disabling fail-fast, adding Android support, CodeQL scanning, and cache cleanup workflows. The architecture is well-thought-out with dynamic matrix generation and cross-platform documentation path detection.


Critical Issues

1. Version Reference Inconsistency (HIGH)

Files: .github/workflows/SyntaxKit.yml lines 77, 123, 159, 242, 287

The PR description states upgrading to v1.5.2, but the actual workflow uses a branch name:

# Current (problematic)
- uses: brightdigit/swift-build@90-windows-cache-symlinks

# Expected (from PR description)
- uses: brightdigit/swift-build@v1.5.2

Using a mutable branch reference instead of a pinned release tag is a CI reliability risk — the branch could be rebased or force-pushed at any time, breaking builds silently. All 5 instances should be updated to @v1.5.2 unless there is a specific reason to track the branch (which should be documented).


Code Quality

2. Missing Memoization in Settings.projectRoot (MEDIUM)

File: Tests/SyntaxDocTests/Settings.swift lines 15–49

Each call re-executes up to 4 sequential filesystem stat operations (FileManager.default.fileExists). Consider lazy initialization or caching the result:

// Example: make it a lazy static
static let projectRoot: URL = {
    // ... existing resolution logic
}()

This avoids repeated I/O overhead if projectRoot is accessed multiple times during a test run.

3. Hardcoded Relative Paths in Documentation Tests (MEDIUM)

File: Tests/SyntaxDocTests/DocumentationExampleTests.swift lines 44–45, 59–60

Paths like "Documentation.docc/Tutorials/Quick-Start-Guide.md" are hardcoded without verifying the path resolves before use. If the Android build strategy changes, these tests could fail silently or with confusing errors. Consider adding an existence assertion before the test body runs.

4. No Error Handling on Mint Clone (LOW)

File: .github/workflows/SyntaxKit.yml lines 327–331

The Mint installation step clones from GitHub with no explicit error handling. A failed clone would produce a misleading error downstream. Consider adding || exit 1 or using a pinned Mint release artifact.


Potential Bugs

5. Android Job Not Yet Validated

The new build-android job is entirely new and there are no visible CI results for it on this PR. The aggressive disk space cleanup (free-disk-space action) could cause tool availability issues. Recommend verifying the Android workflow runs successfully end-to-end before merging.

6. Build Matrix Size

  • Ubuntu: 4 Swift versions × 2 OS variants × 3 build types ≈ 24 jobs
  • Android: 2 Swift versions × 2 API levels = 4 jobs
  • macOS-full: 6 configurations

~40 concurrent jobs on every PR is substantial. If CI minutes are a concern, consider whether all combinations need to run on every PR vs. only on main.


Positives

  • Dynamic matrix generation via configure job is a clean approach to reducing duplication
  • fail-fast: false on Ubuntu is the right call for cross-platform CI
  • The 4-strategy fallback approach in Settings.projectRoot is well-designed for the variety of build environments
  • CodeQL addition is a good security practice
  • Cache cleanup workflows are well-scoped (correct use of actions: write only)
  • concurrency group configuration prevents redundant workflow runs

Test Coverage Gaps

  • No unit tests for Settings.projectRoot path resolution strategies (WASI, Android, symlink paths)
  • cleanup-caches.yml and cleanup-pr-caches.yml cannot be validated until branches/PRs are actually deleted — consider adding a dry-run mode or manual trigger

Recommendation

The main blocker is the brightdigit/swift-build version reference — please either pin to @v1.5.2 as described, or document why the branch is intentionally being tracked. Everything else ranges from minor quality improvements to monitoring items suitable for follow-up.

@leogdion leogdion closed this Apr 3, 2026
@leogdion leogdion deleted the workflow-matrix-updates branch April 3, 2026 17:28
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