Skip to content

Commit

Permalink
Setup danger
Browse files Browse the repository at this point in the history
  • Loading branch information
phimage committed Apr 22, 2018
1 parent edfe46f commit 09bf4ac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode9
osx_image: xcode9.3
env:
global:
- LC_CTYPE=en_US.UTF-8
Expand All @@ -13,13 +13,23 @@ env:
- DESTINATION="OS=11.0,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK"
- DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK"
before_install:
- bundle install
- brew update
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- brew outdated swiftlint || brew upgrade swiftlint
script:
- set -o pipefail
- xcodebuild -version
- xcodebuild -showsdks

- xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;

- bundle exec danger

after_success:
- sleep 10 # Workaround for https://github.com/travis-ci/travis-ci/issues/4725
- bash <(curl -s https://codecov.io/bash) -J 'OAuthSwift'

branches:
only:
- master
13 changes: 13 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
not_declared_trivial = !(github.pr_title.include? "#no-public-changes")
has_app_changes = !git.modified_files.grep(/Sources/).empty?

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# Run SwiftLint
swiftlint.lint_files
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'xcpretty'
gem 'danger'
gem 'danger-swiftlint'

0 comments on commit 09bf4ac

Please sign in to comment.