From de8158c040a0c62891b7725e07af2edea1d49423 Mon Sep 17 00:00:00 2001 From: Scott Marchant Date: Fri, 14 Nov 2025 13:25:27 -0700 Subject: [PATCH 1/3] build: Initial commit of swift package init with package name nio-async-runtime and target/library name NIOAsyncRuntime --- .gitignore | 10 ++-------- Package.swift | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 Package.swift 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.swift b/Package.swift new file mode 100644 index 0000000..86cdc29 --- /dev/null +++ b/Package.swift @@ -0,0 +1,32 @@ +// 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"] + ), + ], + targets: [ + .target( + name: "NIOAsyncRuntime" + ), + .testTarget( + name: "NIOAsyncRuntimeTests", + dependencies: ["NIOAsyncRuntime"] + ), + ] +) From 612c87b28621a10ca6dd020eddd4f994958132e4 Mon Sep 17 00:00:00 2001 From: Scott Marchant Date: Fri, 14 Nov 2025 14:05:38 -0700 Subject: [PATCH 2/3] build: Add dependencies used by NIOAsyncRuntime. --- Package.resolved | 42 ++++++++++++++++++++++++++++++++++++++++++ Package.swift | 46 ++++++++++++++++++++++++++++++---------------- 2 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 Package.resolved 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 index 86cdc29..7c6a56c 100644 --- a/Package.swift +++ b/Package.swift @@ -13,20 +13,34 @@ import PackageDescription let package = Package( - name: "nio-async-runtime", - products: [ - .library( - name: "NIOAsyncRuntime", - targets: ["NIOAsyncRuntime"] - ), - ], - targets: [ - .target( - name: "NIOAsyncRuntime" - ), - .testTarget( - name: "NIOAsyncRuntimeTests", - dependencies: ["NIOAsyncRuntime"] - ), - ] + 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"), + ], + ), + ] ) From 5f6892f47ce67cd471f8253991ea2b628e01da9a Mon Sep 17 00:00:00 2001 From: Scott Marchant Date: Mon, 1 Dec 2025 16:22:33 -0700 Subject: [PATCH 3/3] ci: Set up basic pull request CI using https://github.com/PassiveLogic/swift-dispatch-async/blob/main/.github/workflows/pull_request.yml as a source of inspiration. --- .github/workflows/pull_request.yml | 44 ++++++++++++++++++++++ Sources/NIOAsyncRuntime/Empty.swift | 0 Tests/NIOAsyncRuntimeTests/EmptyTest.swift | 0 3 files changed, 44 insertions(+) create mode 100644 .github/workflows/pull_request.yml create mode 100644 Sources/NIOAsyncRuntime/Empty.swift create mode 100644 Tests/NIOAsyncRuntimeTests/EmptyTest.swift 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/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