From 96f2b86096503f441482a5c9dcb72ff2effbb448 Mon Sep 17 00:00:00 2001 From: yuncheol-AHN Date: Fri, 8 Nov 2024 00:14:51 +0900 Subject: [PATCH] build: github actions work flow for swiftlint --- .github/workflows/swiftlint.yml | 25 +++++++++++++++ Package.swift | 56 +++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/workflows/swiftlint.yml create mode 100644 Package.swift diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 00000000..b3931aa7 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,25 @@ +name: swiftlint πŸ”¨ + +on: + pull_request: + branches: ["develop"] + paths: + - ".github/workflows/swiftlint.yml" + - ".swiftlint.yml" + - "**/*.swift" + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + - name: GitHub Action for SwiftLint (Only files changed in the PR) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + DIFF_BASE: ${{ github.base_ref }} + - name: GitHub Action for SwiftLint (Different working directory) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + WORKING_DIRECTORY: Source diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..f64c7f37 --- /dev/null +++ b/Package.swift @@ -0,0 +1,56 @@ +import PackageDescription + +let package = Package( + name: "MemorialHouse", + products: [ + .library(name: "MHDomain", targets: ["MHDomain"]), + .library(name: "MHCore", targets: ["MHCore"]), + .library(name: "MHData", targets: ["MHData"]), + .library(name: "MHFoundation", targets: ["MHFoundation"]), + .library(name: "MHPresentation", targets: ["MHPresentation"]), + .library(name: "MHApplication", targets: ["MHApplication"]), + ], + dependencies: [ + .package(url: "https://github.com/realm/SwiftLintPlugins", from: "0.57.0"), + ], + targets: [ + .target( + name: "MHDomain", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHCore", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHData", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHFoundation", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHPresentation", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHApplication", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") // ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” + ] + ), + ], + swiftLanguageVersions: [.v6] +) +