Skip to content

Commit 1c318b5

Browse files
authored
new runner and executor (#7)
1 parent 6748192 commit 1c318b5

File tree

12 files changed

+366
-255
lines changed

12 files changed

+366
-255
lines changed

.github/workflows/actions.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Actions
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
run-checks:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
image:
15+
- 'swift:5.9'
16+
- 'swift:5.10'
17+
container:
18+
image: ${{ matrix.image }}
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
26+
- name: Check Broken Symlinks
27+
uses: feather-actions/check-broken-symlinks@0.0.2
28+
29+
#- name: Check Unacceptable Language
30+
# uses: feather-actions/check-language@0.0.4
31+
32+
- name: Check Local Swift Dependencies
33+
uses: feather-actions/check-local-swift-dependencies@0.0.3
34+
35+
- name: Run Swift Format
36+
uses: feather-actions/run-swift-format@0.0.2
37+
38+
run-tests:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
image:
43+
- 'swift:5.9'
44+
- 'swift:5.10'
45+
container:
46+
image: ${{ matrix.image }}
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Run Swift Tests
53+
uses: feather-actions/run-swift-tests@0.0.2

.github/workflows/run-checks.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/run-tests.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

Package.resolved

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ let package = Package(
1414
.library(name: "FeatherSpecHummingbird", targets: ["FeatherSpecHummingbird"]),
1515
],
1616
dependencies: [
17-
.package(url: "https://github.com/feather-framework/feather-spec", .upToNextMinor(from: "0.3.0")),
18-
.package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.0.0-beta.1"),
17+
.package(url: "https://github.com/feather-framework/feather-spec", .upToNextMinor(from: "0.4.0")),
18+
.package(url: "https://github.com/hummingbird-project/hummingbird", from: "2.0.0-rc.3"),
1919

2020
],
2121
targets: [
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import OpenAPIRuntime
2+
import HTTPTypes
3+
import Hummingbird
4+
import HummingbirdTesting
5+
import FeatherSpec
6+
7+
extension HTTPBody {
8+
9+
/// Collects data asynchronously and returns it as a `ByteBuffer`.
10+
///
11+
/// This function handles two cases for the length of the data:
12+
/// 1. If the length is known, it collects up to the specified number of bytes.
13+
/// 2. If the length is unknown, it collects data chunks until the sequence is exhausted.
14+
///
15+
/// - Returns: A `ByteBuffer` containing the collected data.
16+
///
17+
/// - Throws: Rethrows an underlying error.
18+
func collect() async throws -> ByteBuffer {
19+
var buffer = ByteBuffer()
20+
switch length {
21+
case .known(let value):
22+
try await collect(upTo: Int(value), into: &buffer)
23+
case .unknown:
24+
for try await chunk in self {
25+
buffer.writeBytes(chunk)
26+
}
27+
}
28+
return buffer
29+
}
30+
}

0 commit comments

Comments
 (0)