diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3d22b90 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,18 @@ +name: "Run SwiftLint" +run-name: Linting +on: + pull_request: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + with: + args: --strict diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b6a180a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,10 @@ +name: "Run Tests" +run-name: Testing +on: [pull_request] +jobs: + Test: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - name: Test StreamDeckKit + run: set -o pipefail && xcodebuild -scheme StreamDeckKit-Package test -destination "platform=iOS Simulator,name=iPhone 15,OS=latest" -skipMacroValidation | xcpretty diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..f540fe2 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,7 @@ +opt_in_rules: + - overridden_super_call + +disabled_rules: + - identifier_name + +line_length: 150 diff --git a/Package.swift b/Package.swift index 7edcddb..d1b80f7 100644 --- a/Package.swift +++ b/Package.swift @@ -9,8 +9,8 @@ let package = Package( platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .macCatalyst(.v13)], products: [ .library( - name: "StreamDeckKitMacros", - targets: ["StreamDeckKitMacros"] + name: "StreamDeckView", + targets: ["StreamDeckView"] ) ], dependencies: [ @@ -18,17 +18,17 @@ let package = Package( ], targets: [ .macro( - name: "StreamDeckView", + name: "StreamDeckKitMacros", dependencies: [ .product(name: "SwiftSyntaxMacros", package: "swift-syntax"), .product(name: "SwiftCompilerPlugin", package: "swift-syntax") ] ), - .target(name: "StreamDeckKitMacros", dependencies: ["StreamDeckView"]), + .target(name: "StreamDeckView", dependencies: ["StreamDeckKitMacros"]), .testTarget( name: "StreamDeckKitMacrosTests", dependencies: [ - "StreamDeckView", + "StreamDeckKitMacros", .product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"), ] ), diff --git a/Sources/StreamDeckView/StreamDeckViewMacro.swift b/Sources/StreamDeckKitMacros/StreamDeckViewMacro.swift similarity index 100% rename from Sources/StreamDeckView/StreamDeckViewMacro.swift rename to Sources/StreamDeckKitMacros/StreamDeckViewMacro.swift diff --git a/Sources/StreamDeckKitMacros/StreamDeckKitMacros.swift b/Sources/StreamDeckView/StreamDeckView.swift similarity index 98% rename from Sources/StreamDeckKitMacros/StreamDeckKitMacros.swift rename to Sources/StreamDeckView/StreamDeckView.swift index 175ace6..2bc16ac 100644 --- a/Sources/StreamDeckKitMacros/StreamDeckKitMacros.swift +++ b/Sources/StreamDeckView/StreamDeckView.swift @@ -72,4 +72,4 @@ public protocol StreamDeckView: View { /// ``` @attached(extension, conformances: StreamDeckView) @attached(member, names: named(_$streamDeckViewContext), named(body), named(streamDeck), named(viewSize), named(viewIndex)) -public macro StreamDeckView() = #externalMacro(module: "StreamDeckView", type: "StreamDeckViewMacro") +public macro StreamDeckView() = #externalMacro(module: "StreamDeckKitMacros", type: "StreamDeckViewMacro")