diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..771551f --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,16 @@ +name: build +on: + push: + branches: ['**'] + tags: ['v*'] +jobs: + macos: + uses: self:KofTwentyTwo/ci-workflows/.gitea/workflows/macos.yaml@v1 + secrets: inherit + with: + # Build only: the app and the test bundle are compiled unsigned, the tests are not run. They are + # app-hosted XCTests and the grogu runner has no GUI session for testmanagerd; run `just test` + # locally before merging (README, Building from Source). Package.swift has no test target. + commands: | + xcodegen generate + xcodebuild -quiet -project markdownViewr.xcodeproj -scheme markdownViewr -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO build-for-testing diff --git a/README.md b/README.md index c373514..caa7000 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,12 @@ just run ``` `just --list` shows all available recipes. + +### Tests + +The tests are app-hosted XCTests (`markdownViewrTests`). CI builds the app and the test bundle unsigned +but does not run them (the CI macOS runner has no GUI session), so run them locally before merging: + +```bash +just test # xcodegen generate first if the project is stale +``` diff --git a/markdownViewr/MarkdownDocument.swift b/markdownViewr/MarkdownDocument.swift index 212caf9..df800f0 100644 --- a/markdownViewr/MarkdownDocument.swift +++ b/markdownViewr/MarkdownDocument.swift @@ -275,7 +275,7 @@ struct MarkdownDocument: FileDocument { private struct HTMLConverter: MarkupWalker { private var result = "" - mutating func visit(_ document: Document) -> String { + mutating func visit(_ document: Markdown.Document) -> String { result = "" for child in document.children { visitChild(child)