diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..47f41da --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,44 @@ +name: Pull request + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + format_check_container_image: swift:6.1.0-noble + license_header_check_enabled: false + api_breakage_check_enabled: false + + tests: + name: Tests + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + with: + enable_macos_checks: false + linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"5.10.1\"}, {\"swift_version\": \"6.0\"}]" + enable_windows_checks: false + enable_wasm_sdk_build: true + enable_embedded_wasm_sdk_build: false + + wasm-sdk: + name: WebAssembly SDK + runs-on: ubuntu-latest + container: + image: "swift:6.1.0-noble" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Swift version + run: swift --version + - name: WasmBuild + run: | + apt-get update -y -q + apt-get install -y -q curl + apt-get install -y -q jq + version="$(swift --version | head -n1)" + tag="$(curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json" | jq -e -r --arg v "$version" '.[$v] | .[-1]')" + curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$tag.json" | jq -r '.["swift-sdks"]["wasm32-unknown-wasi"] | "swift sdk install \"\(.url)\" --checksum \"\(.checksum)\""' | sh -x + swift build --swift-sdk wasm32-unknown-wasi diff --git a/.gitignore b/.gitignore index 52fe2f7..53298db 100644 --- a/.gitignore +++ b/.gitignore @@ -18,16 +18,10 @@ timeline.xctimeline playground.xcworkspace # Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -# *.xcodeproj -# + # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata # hence it is not needed unless you have added a package configuration file to your project -# .swiftpm +.swiftpm .build/ diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..2e74a4a --- /dev/null +++ b/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "23e94f6a7762b68c41183501a81832fe19ff8108a47e2adf1db0fda8cd2e7bea", + "pins" : [ + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "56724a2b6d8e2aed1b2c5f23865b9ea5c43f9977", + "version" : "2.89.0" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "395a77f0aa927f0ff73941d7ac35f2b46d47c9db", + "version" : "1.6.3" + } + } + ], + "version" : 3 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..7c6a56c --- /dev/null +++ b/Package.swift @@ -0,0 +1,46 @@ +// swift-tools-version: 6.0 +//===----------------------------------------------------------------------===// +// +// Copyright (c) 2025 PassiveLogic, Inc. +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "nio-async-runtime", + products: [ + .library( + name: "NIOAsyncRuntime", + targets: ["NIOAsyncRuntime"] + ) + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.89.0"), + ], + targets: [ + .target( + name: "NIOAsyncRuntime", + dependencies: [ + .product(name: "Atomics", package: "swift-atomics"), + .product(name: "NIOCore", package: "swift-nio"), + ], + ), + .testTarget( + name: "NIOAsyncRuntimeTests", + dependencies: [ + "NIOAsyncRuntime", + .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), + .product(name: "NIOCore", package: "swift-nio"), + .product(name: "NIOFoundationCompat", package: "swift-nio"), + .product(name: "NIOTestUtils", package: "swift-nio"), + ], + ), + ] +) diff --git a/Sources/NIOAsyncRuntime/Empty.swift b/Sources/NIOAsyncRuntime/Empty.swift new file mode 100644 index 0000000..e69de29 diff --git a/Tests/NIOAsyncRuntimeTests/EmptyTest.swift b/Tests/NIOAsyncRuntimeTests/EmptyTest.swift new file mode 100644 index 0000000..e69de29