diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 0000000..22ae699 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,16 @@ +name: SwiftLint + +on: + pull_request: + 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@master diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02c0875 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..8ff8f45 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:4.2 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "test-action-swiftlint", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "test-action-swiftlint", + targets: ["test-action-swiftlint"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "test-action-swiftlint", + dependencies: []), + .testTarget( + name: "test-action-swiftlintTests", + dependencies: ["test-action-swiftlint"]), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f24d38 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# test-action-swiftlint + +A description of this package. diff --git a/Sources/test-action-swiftlint/test_action_swiftlint.swift b/Sources/test-action-swiftlint/test_action_swiftlint.swift new file mode 100644 index 0000000..18516f6 --- /dev/null +++ b/Sources/test-action-swiftlint/test_action_swiftlint.swift @@ -0,0 +1,3 @@ +struct test_action_swiftlint { + var text = "Hello, World!" +} diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..4054cfc --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import test_action_swiftlintTests + +var tests = [XCTestCaseEntry]() +tests += test_action_swiftlintTests.allTests() +XCTMain(tests) \ No newline at end of file diff --git a/Tests/test-action-swiftlintTests/XCTestManifests.swift b/Tests/test-action-swiftlintTests/XCTestManifests.swift new file mode 100644 index 0000000..8a08d7f --- /dev/null +++ b/Tests/test-action-swiftlintTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !os(macOS) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(test_action_swiftlintTests.allTests), + ] +} +#endif \ No newline at end of file diff --git a/Tests/test-action-swiftlintTests/test_action_swiftlintTests.swift b/Tests/test-action-swiftlintTests/test_action_swiftlintTests.swift new file mode 100644 index 0000000..1e5a10f --- /dev/null +++ b/Tests/test-action-swiftlintTests/test_action_swiftlintTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import test_action_swiftlint + +final class test_action_swiftlintTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(test_action_swiftlint().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +}