Skip to content

ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191

Open
juliusknorr wants to merge 7 commits into
mainfrom
claude/test-coverage-github-actions-qd7p5y
Open

ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191
juliusknorr wants to merge 7 commits into
mainfrom
claude/test-coverage-github-actions-qd7p5y

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Adds CI to actually run the unit test suite, fixes the SwiftLint workflow that was silently not running, and adds Dependabot.

juliusknorr and others added 7 commits July 9, 2026 13:26
Add a Tests workflow that runs the IOCNotesUnitTests suite via
`xcodebuild test` on a macOS runner for pushes and pull requests to main.

Also remove the stale `iOCNotesTests` testable from the shared iOCNotes
scheme; that target no longer exists in the project and would break
`xcodebuild test`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The SwiftLint workflow was named `.swiftlint.yml`; GitHub Actions ignores
workflow files whose names begin with a dot, so the lint check never ran.
Rename it to `swiftlint.yml` so it is discovered and executed.

Add `.github/dependabot.yml` to keep Swift Package Manager dependencies and
the GitHub Actions used in our workflows up to date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The test job hard-coded /Applications/Xcode_26.app, which does not exist on
the runner and failed with "invalid developer directory". Switch to the
macos-15 runner and select the newest installed Xcode dynamically so the job
no longer depends on a specific Xcode path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The build embeds the SwiftLint build tool plugin, which requires interactive
trust and fails in headless CI with "Plugin SwiftLintBuildToolPlugin ... must
be enabled before it can be used". Pass -skipPackagePluginValidation to
xcodebuild so package plugins are trusted automatically on the runner.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
All tests currently fail instantly with no assertion output, which points to
the host application failing to launch in the simulator. Add a failure-only
step that extracts the test-results summary and any crash logs from the
.xcresult bundle so the real cause is visible in the build log.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The whole test host process traps (signal trap) originating in the markdown
formatting path, and the target's scheme marks it parallelizable, so every
test then reports "crashed with signal trap". Disable parallel testing so the
run is deterministic and xcodebuild prints the actual fatal-error line, which
also rules in/out a concurrency cause.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
…ndices

MarkdownTextStorage.processEditing crashed the whole test suite with
"String index is out of bounds" (signal trap) via String.nsRange(from:),
which force-unwrapped samePosition(in:) and ran utf16.distance on indices
that may not belong to the current backing string.

- nsRange(from:): validate the range lies within the string and return an
  empty NSNotFound range instead of trapping on foreign/stale indices.
- processEditing: clamp the edited location to the string length and
  intersect the formatting range with the full range, skipping formatting
  when the line conversion fails.
- MarkdownTextStorageTests.applyText: use the UTF-16 length rather than the
  grapheme count, which is what NSTextStorage ranges are measured in.

Also export crash backtraces from the .xcresult on failure so future
crashes are diagnosable directly from the CI log.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuMUmwcBag6qfvo3B4zzKN
Signed-off-by: Julius Knorr <jus@bitgrid.net>
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