diff --git a/Dangerfile.swift b/Dangerfile.swift new file mode 100644 index 00000000..830adbb4 --- /dev/null +++ b/Dangerfile.swift @@ -0,0 +1,12 @@ +// Dangerfile.swift + +import Foundation +import Danger + +let danger = Danger() + +if danger.git.createdFiles.count + danger.git.modifiedFiles.count - danger.git.deletedFiles.count > 10 { + warn("Big PR, try to keep changes smaller if you can") +} + +SwiftLint.lint(directory: "CrowdinSDK/", configFile: "CrowdinSDK/Classes/.swiftlint.yml") diff --git a/_dangerfile_imports.swift b/_dangerfile_imports.swift new file mode 100644 index 00000000..6844e009 --- /dev/null +++ b/_dangerfile_imports.swift @@ -0,0 +1 @@ +import DangerSwiftLint // package: https://github.com/ashfurrow/DangerSwiftLint.git \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b6e2ced5..161ac5d6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,19 +13,29 @@ trigger: - LICENSE jobs: + - job: DangerSwiftLint + pool: + vmImage: 'macOS 10.14' + steps: + - bash: | + brew install swiftlint ; brew install danger/tap/danger-swift ; export DANGER_GITHUB_API_TOKEN='$(DANGER_GITHUB_API_TOKEN)' ; danger-swift ci + displayName: 'Danger SwiftLint' + - job: PodInstall + dependsOn: DangerSwiftLint + condition: succeeded() pool: - vmImage: 'macOS 10.13' + vmImage: 'macOS 10.14' steps: - bash: | - cd Tests ; pod update Starscream; pod install + cd Tests ; pod update Starscream; pod update BaseAPI; pod install displayName: 'Installing cocoapods' - job: Build dependsOn: PodInstall condition: succeeded() pool: - vmImage: 'macOS 10.13' + vmImage: 'macOS 10.14' steps: - task: Xcode@5 displayName: 'Build Xcode App' @@ -42,7 +52,7 @@ jobs: dependsOn: Build condition: succeeded() pool: - vmImage: 'macOS 10.13' + vmImage: 'macOS 10.14' steps: - task: Xcode@5 displayName: 'Running tests'