-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to align the CI with vscode file
- Loading branch information
Jan Stevens
committed
Oct 3, 2019
1 parent
26e3634
commit e3a7903
Showing
6 changed files
with
89 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
lint_and_unit: &lint_and_unit | ||
- delivery | ||
- danger | ||
- lint-yaml | ||
- lint-markdown | ||
|
||
version: 2.1 | ||
orbs: | ||
kitchen: sous-chefs/kitchen@2 | ||
|
||
workflows: | ||
kitchen: | ||
jobs: | ||
# Lint and Unit Test | ||
- kitchen/yamllint: | ||
name: lint-yaml | ||
- kitchen/mdlint: | ||
name: lint-markdown | ||
- kitchen/danger: | ||
name: danger | ||
context: Danger | ||
- kitchen/delivery: | ||
name: delivery | ||
|
||
- kitchen/dokken-single: | ||
name: default | ||
suite: default | ||
requires: | ||
*lint_and_unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Reference: http://danger.systems/reference.html | ||
|
||
# A pull request summary is required. Add a description of the pull request purpose. | ||
# Changelog must be updated for each pull request that changes code. | ||
# Warnings will be issued for: | ||
# Pull request with more than 400 lines of code changed | ||
# Pull reqest that change more than 5 lines without test changes | ||
# Failures will be issued for: | ||
# Pull request without summary | ||
# Pull requests with code changes without changelog entry | ||
|
||
def code_changes? | ||
code = %w(libraries attributes recipes resources files templates) | ||
code.each do |location| | ||
return true unless git.modified_files.grep(/#{location}/).empty? | ||
end | ||
false | ||
end | ||
|
||
def test_changes? | ||
tests = %w(spec test .kitchen.yml .kitchen.dokken.yml) | ||
tests.each do |location| | ||
return true unless git.modified_files.grep(/#{location}/).empty? | ||
end | ||
false | ||
end | ||
|
||
fail 'Please provide a summary of your Pull Request.' if github.pr_body.length < 10 | ||
|
||
warn 'This is a big Pull Request.' if git.lines_of_code > 400 | ||
|
||
# Require a CHANGELOG entry for non-test changes. | ||
if !git.modified_files.include?('CHANGELOG.md') && code_changes? | ||
fail 'Please include a CHANGELOG entry.' | ||
end | ||
|
||
# A sanity check for tests. | ||
if git.lines_of_code > 5 && code_changes? && !test_changes? | ||
warn 'This Pull Request is probably missing tests.' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters