ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191
Open
juliusknorr wants to merge 3 commits into
Open
ci: run unit tests on GitHub Actions, revive SwiftLint, add Dependabot#191juliusknorr wants to merge 3 commits into
juliusknorr wants to merge 3 commits into
Conversation
6d97c00 to
471300b
Compare
Add a Tests workflow that runs the IOCNotesUnitTests suite via `xcodebuild test` on a macos-15 runner for pushes and pull requests to main, selecting the newest installed Xcode dynamically. - Pass -skipPackagePluginValidation so the embedded SwiftLint build tool plugin is trusted automatically in headless CI. - Disable parallel testing so runs are deterministic and fatal errors are attributable. - On failure, extract the test-results summary and crash backtraces from the .xcresult bundle so the real cause is visible in the build log. Also remove the stale `iOCNotesTests` testable from the shared iOCNotes scheme; that target no longer exists and would break `xcodebuild test`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> 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>
…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. - Stabilize the markdown test suite: measure ranges in UTF-16 length (what NSTextStorage uses) rather than grapheme count. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Julius Knorr <jus@bitgrid.net>
471300b to
f22c443
Compare
Collaborator
|
Hi @juliusknorr, thanks :) Could you reproduce this crash? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gets CI actually running for the project and fixes a crash uncovered along the way.
Testsworkflow runs theIOCNotesUnitTestssuite viaxcodebuild teston amacos-15runner (newest installed Xcode selected dynamically) for pushes and PRs tomain. Skips package plugin validation, disables parallel testing for deterministic runs, and dumps the test summary and crash backtraces from the.xcresultbundle on failure. Also drops the staleiOCNotesTeststestable from the shared scheme..swiftlint.yml, which GitHub Actions ignores (leading dot), so the check never ran; renamed toswiftlint.yml. Added.github/dependabot.ymlfor SwiftPM and GitHub Actions updates.MarkdownTextStorage.processEditingtrapped the whole test suite with "String index is out of bounds" viaString.nsRange(from:). Hardened range conversion to validate indices, clamp the edited location, and skip formatting on conversion failure; test suite now measures ranges in UTF-16 length.