Skip to content

ci(desktop): build and test Swift app in PRs - #9111

Merged
Git-on-my-level merged 3 commits into
mainfrom
codex/desktop-swift-ci-8842
Jul 6, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
codex/desktop-swift-ci-8842

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a path-filtered macOS CI job for desktop Swift changes
  • run the release Swift build before merge: xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx
  • run Swift XCTest suites through a shared per-suite isolation script used by both CI and desktop/macos/test.sh
  • make the memory-bank connector process timeout test setup less brittle on loaded CI machines

Closes #8842.

CI weight / timing

Measured locally on this Mac while developing the PR:

  • release Swift build: 348s (5m48s), including SwiftPM dependency checkout/fetch from local cache
  • isolated Swift suite runner before timeout hardening: 269s (4m29s), failed on a 2s helper timeout
  • isolated Swift suite runner after timeout hardening: 208s (3m28s), 128 suites passed

Expected full desktop Swift job cost is roughly 9-10 minutes cold-ish for desktop Swift PRs, with SwiftPM cache expected to reduce subsequent runs. The job exits after the changed-file check for non-desktop-Swift PRs.

Tests

  • xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx
  • xcrun swift test --package-path Desktop --filter 'MemoryBankConnectorTests/testCodexConnectRedactsTokenFromCLIError'
  • ./scripts/swift-test-suites.sh
  • /opt/homebrew/bin/actionlint -shellcheck "" .github/workflows/lint.yml
  • bash -n desktop/macos/test.sh desktop/macos/scripts/swift-test-suites.sh
  • git diff --check

Review in cubic

@Git-on-my-level Git-on-my-level added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Jul 6, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 issues found across 4 files

Confidence score: 3/5

  • In .github/workflows/lint.yml, the SwiftPM cache key uses hashFiles('desktop/macos/Desktop/Package.resolved'), which is absent before dependency resolution, so cache keys can become unstable and reduce cache effectiveness or cause inconsistent CI behavior — point the key at a committed lockfile path (or another deterministic input) before merging.
  • In .github/workflows/lint.yml, the changed-file filter excludes renames, so Swift file renames can bypass the desktop Swift CI job and let regressions slip through untested — include rename status in --diff-filter so path-matched renames still trigger the job.
  • In desktop/macos/scripts/swift-test-suites.sh, the XCTest discovery regex may miss some valid XCTestCase declarations (like extension-based cases), which can silently under-run test suites in CI — broaden discovery logic or add a fallback check to ensure all intended tests are executed.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/lint.yml Resolved
Comment thread .github/workflows/lint.yml Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2dba14984c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/lint.yml Resolved
Comment thread .github/workflows/lint.yml Resolved
@Git-on-my-level
Git-on-my-level force-pushed the codex/desktop-swift-ci-8842 branch from 2dba149 to ce10e2f Compare July 6, 2026 04:05
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor update for PR #9111:

  • Switched the Desktop Swift CI job to macos-15 so SwiftPM can resolve Swift 6 toolchain dependencies.
  • Installed pkg-config/webp before SwiftPM build/test so the CWebP system library is available on fresh macOS runners.
  • Changed the Desktop Swift trigger to include renames and deletions, while keeping the general lint changed-file filter unchanged.
  • Changed the SwiftPM cache key to hash desktop/macos/Desktop/Package.swift instead of the non-checked-in Package.resolved.
  • Broadened isolated Swift suite discovery for access modifiers/attributes and extension-style declarations.
  • Made QueryTracerTests/testTTFTMarking deterministic after the newly enabled CI lane exposed timing variance on the macOS runner.

Verification passed:

  • bash -n desktop/macos/scripts/swift-test-suites.sh desktop/macos/test.sh
  • isolated suite discovery smoke check: 134 suites discovered
  • actionlint -shellcheck "" .github/workflows/lint.yml
  • git diff --check
  • xcrun swift build -c release --package-path Desktop --triple arm64-apple-macosx
  • xcrun swift test --package-path Desktop --filter 'QueryTracerTests/testTTFTMarking'
  • GitHub checks on f4944b77a73d2cc816760d98f9d061355cfed392: Lint & Format Check, Desktop Swift Build & Tests, and cubic AI reviewer all passed.

Resolved the five bot review threads addressed by these changes.

@Git-on-my-level
Git-on-my-level merged commit 730e3fc into main Jul 6, 2026
4 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/desktop-swift-ci-8842 branch July 6, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[desktop/macos] CI: Swift app is never compiled or tested before merge

1 participant