Skip to content

Commit

Permalink
Add CI PR testing
Browse files Browse the repository at this point in the history
Add Danger
  • Loading branch information
m1guelpf authored Dec 8, 2016
2 parents 019e68c + 96dde89 commit 5ffda95
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ rvm:
- 2.3.3
install:
- bundle install
- gem install danger
script:
- bundle exec jekyll build
- docker run --volume=$(pwd):/app --workdir=/app coala/base coala -C
- danger --verbose
branches:
only:
- gh-pages # Must be appear explicitly
Expand Down
14 changes: 14 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Message the user
message "Hi @#{github.pr_author} thank you for your submission at Fossasia's GCI 2016 website. Please correct any issues below, if any."
# Chech if a PR is mergeable and war if you have merge issues
can_merge = github.pr_json["mergeable"]
warn("This PR appears to have merge errors. Please check Contribuiting.md for help solving that.", sticky: false) unless can_merge
# Check for PR description
fail 'Please provide a summary in the Pull Request description, containing, at less, your live link.' if github.pr_body.length < 5
# Warn if there is [WIP] in the title
warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]"
# Check if user is a member of the FOSSASIA github org
unless github.api.organization_member?('FOSSASIA', github.pr_author)
message "@#{github.pr_author} you don't appear to be in the FOSSASIA organization, you must fill in [this form](http://fossasia.org/apply-pupils) to be added."
end
fail 'Please add your live link to the PR body.' if !github.pr_body.include? 'http'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://rubygems.org'
gem 'github-pages'
gem 'html-proofer'
gem 'danger'

0 comments on commit 5ffda95

Please # to comment.