Skip to content

Commit

Permalink
Merge pull request #146 from xing/add-ci
Browse files Browse the repository at this point in the history
Add CI & Danger
  • Loading branch information
BasThomas authored Jan 24, 2018
2 parents 1016a57 + d9c6ed3 commit 93a055e
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
jobs:
build:
macos:
xcode: "9.2.0"
shell: /bin/bash --login -eo pipefail
steps:
- checkout
- run:
name: Set Ruby Version
command: echo "ruby-2.4" > ~/.ruby-version

- run:
name: Install Dependencies
command: bundle install

- run:
name: Run Danger
command: bundle exec danger
when: always
12 changes: 12 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
not_declared_trivial = !github.pr_title.include?("trivial")

has_launcher_changes = !git.modified_files.grep(/Launcher/).empty?
has_core_changes = !git.modified_files.grep(/Core/).empty?
no_changelog_entry = !git.modified_files.include?("Changelog.md")

warn("The pull request is classed as Work in Progress") if github.pr_title.include? "WIP"
warn("Big pull request") if git.lines_of_code > 500

if (has_launcher_changes || has_core_changes) && not_declared_trivial
warn("Any changes to library code should be reflected in the Changelog. Please consider adding a note there.")
end
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gem 'danger'
53 changes: 53 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
claide (1.0.2)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (5.5.6)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (~> 0.9)
faraday-http-cache (~> 1.0)
git (~> 1)
kramdown (~> 1.5)
no_proxy_fix
octokit (~> 4.7)
terminal-table (~> 1)
faraday (0.14.0)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
git (1.3.0)
kramdown (1.16.2)
multipart-post (2.0.0)
nap (1.1.0)
no_proxy_fix (0.1.2)
octokit (4.8.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (3.0.1)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.3.0)

PLATFORMS
ruby

DEPENDENCIES
danger

BUNDLED WITH
1.16.1

0 comments on commit 93a055e

Please sign in to comment.