From 8197137213bea758265e4b5f7192b1f2f00a96ae Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Tue, 25 Dec 2018 00:49:39 +0900 Subject: [PATCH 1/6] Initial commit --- .gitignore | 4 +++ Package.swift | 28 +++++++++++++++++++ README.md | 3 ++ .../test_action_swiftlint.swift | 3 ++ Tests/LinuxMain.swift | 7 +++++ .../XCTestManifests.swift | 9 ++++++ .../test_action_swiftlintTests.swift | 15 ++++++++++ 7 files changed, 69 insertions(+) create mode 100644 .gitignore create mode 100644 Package.swift create mode 100644 README.md create mode 100644 Sources/test-action-swiftlint/test_action_swiftlint.swift create mode 100644 Tests/LinuxMain.swift create mode 100644 Tests/test-action-swiftlintTests/XCTestManifests.swift create mode 100644 Tests/test-action-swiftlintTests/test_action_swiftlintTests.swift 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), + ] +} From 467cb39f3dd2caa7bdd4d945777ea77961b8f99b Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Tue, 25 Dec 2018 00:53:13 +0900 Subject: [PATCH 2/6] [GitHub Action] Add `main.workflow` --- .github/main.workflow | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/main.workflow diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 0000000..7ef6bf6 --- /dev/null +++ b/.github/main.workflow @@ -0,0 +1,9 @@ +workflow "New workflow" { + on = "push" + resolves = ["swiftlint"] +} + +action "swiftlint" { + uses = "norio-nomura/action-swiftlint@master" + secrets = ["GITHUB_TOKEN"] +} From 0cc7334bf2bae1729f1715bfc744127a873c970f Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Mon, 26 Aug 2019 22:09:31 +0900 Subject: [PATCH 3/6] Update to latest GitHub Action --- .github/main.workflow | 9 --------- .github/workflows/main.yml | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) delete mode 100644 .github/main.workflow create mode 100644 .github/workflows/main.yml diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 7ef6bf6..0000000 --- a/.github/main.workflow +++ /dev/null @@ -1,9 +0,0 @@ -workflow "New workflow" { - on = "push" - resolves = ["swiftlint"] -} - -action "swiftlint" { - uses = "norio-nomura/action-swiftlint@master" - secrets = ["GITHUB_TOKEN"] -} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..773304f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,15 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 38fd121c1b3833073be3e7883b3a6a7e23d87d71 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Wed, 18 Sep 2019 22:56:52 +0900 Subject: [PATCH 4/6] Add `pull_request` to events for trigger --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 773304f..41c8059 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [push, pull_request] jobs: build: From 18dd36c30a3c568e007fc73d3f7a391e13155022 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Tue, 1 Oct 2019 21:03:29 +0900 Subject: [PATCH 5/6] Tweak workflow - Rename to swiftlint.yml - Add paths to on.pull_request --- .github/workflows/{main.yml => swiftlint.yml} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename .github/workflows/{main.yml => swiftlint.yml} (61%) diff --git a/.github/workflows/main.yml b/.github/workflows/swiftlint.yml similarity index 61% rename from .github/workflows/main.yml rename to .github/workflows/swiftlint.yml index 41c8059..43cc444 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/swiftlint.yml @@ -1,9 +1,14 @@ -name: CI +name: SwiftLint -on: [push, pull_request] +on: + pull_request: + paths: + - '.github/workflows/swiftlint.yml' + - '.swiftlint.yml' + - '**/*.swift' jobs: - build: + SwiftLint: runs-on: ubuntu-latest From 28b869e04f555e2b19a0b986a429da205ab32278 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Mon, 4 Nov 2019 15:40:36 +0900 Subject: [PATCH 6/6] Remove GITHUB_TOKEN and fix format --- .github/workflows/swiftlint.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index 43cc444..22ae699 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -9,12 +9,8 @@ on: jobs: SwiftLint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: GitHub Action for SwiftLint - uses: norio-nomura/action-swiftlint@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@master