* [CI] Adopt GitHub Actions
# Motivation
We want to adopt GitHub actions in all of our Swift repositories to replace our current Jenkins CI.
# Modification
This PR adopts the reusable workflows from NIO and the swiftlang organization to ensure soundness and test coverage. Additionally, this PR enables a sematic label check and adds a `release.yml` to make releasing this package easy.
# Result
Modern CI and release flow.
This introduces FramingResult, which signals either a "complete" frame, "incomplete", or "invalid".
If a frame is incomplete then the minimum number of required bytes to make a complete frame are sent.
if a frame is invalid or complete then you are provided with the bytes in that frame.
Invalid frames are forwarded onto the user via user events.
It doesn't have many bells and whistles yet, but it handles a lot of use cases we'll see in the wild, and you'll probably still find it useful
Given the command A1 LOG it will delivered .incompleteFrame(2) to signal that this frame is incomplete, and that we need at least 2 more bytes (in this case the CR and LF) to complete the frame (this is because it doesn't have the ability to understand the login command fully as it's only used to build frames).
Given the command A1 LOGIN {3}\r\na it will deliver 2 frames:
.complete("A1 LOGIN {3}\r\n
.complete("a") this is a "complete" frame because we're streaming a literal, so need to forward all bytes as soon as possible
Finally a case of invalid, A1 LOGIN {a will deliver 1 frame containing the data, including the byte where we detected the issue: .invalid("A1 LOGIN {a")
Resolves#556
We've talked quite a bit offline, and decided that for now @_spi is the way to go, as it avoids build system issues. The goal is to remove the number of underscored public types and fields.
We use String(buffer: ByteBuffer) quite a lot. This isn't ideal as it may crash if the bytes are not valid UTF-8. This PR addresses that problem by providing a failable initialiser on String that will handle invalid UTF8 bytes gracefully by returning nil.
Motivation:
Gmail has a couple of common extensions to the IMAP specification for
Gmail specific features. It'd be good to support them. This patch adds
support for the most important three: Gmail message ID, Gmail thread ID,
and the Gmail label functionality.
Modifications:
- Added new Fetch and Message attributes for the three Gmail extensions.
- Added parsing and serialization support.
Result:
Users can interact with Gmail-specific features.
motivation: use standard format across all of our projects
changes:
* add .swiftformat settings based on what we use in other projects
* validate format in the sanity script
* format