diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index bd5a175..d14dd42 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -27,3 +27,18 @@ jobs: run: swift build -v - name: Run tests run: swift test -v + + swift-lint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + # TODO: enable these settings: + # env: + # DIFF_BASE: ${{ github.base_ref }} + # with: + # args: --strict diff --git a/Package.swift b/Package.swift index 84a8f31..573ef15 100644 --- a/Package.swift +++ b/Package.swift @@ -11,10 +11,15 @@ let package = Package( .target( name: "FlagsmithClient", dependencies: [], - path: "FlagsmithClient/Classes"), + path: "FlagsmithClient/Classes", + plugins: [ + .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]), .testTarget( name: "FlagsmitClientTests", dependencies: ["FlagsmithClient"], path: "FlagsmithClient/Tests"), + ], + dependencies: [ + .package(url: "https://github.com/realm/SwiftLint.git", from: "0.54.0") ] )