Skip to content

Commit

Permalink
Chore: adds danger to circle-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Apr 27, 2021
1 parent ecc2fc2 commit ae48ac3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 26 additions & 1 deletion .circleci/config.yml
Expand Up @@ -6,7 +6,15 @@ cache-defaults: &cache-defaults
keys:
- -{{ checksum "package-lock.json" }}

parameters:
env-tests:
type: boolean
default: false

aliases:
- &danger-pr
name: Upload to coveralls
command: npx danger ci -d .dangerfile.js
- &coveralls
name: Upload to coveralls
command: npm run coveralls
Expand Down Expand Up @@ -38,6 +46,15 @@ aliases:
version: 2
debug: true
jobs:
analyze-pr:
<<: *defaults
environment:
DANGER_GITHUB_API_TOKEN: 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
steps:
- checkout
- run: *install
- run: *analyze

install:
<<: *defaults
steps:
Expand Down Expand Up @@ -97,4 +114,12 @@ workflows:
- test-package
filters:
branches:
only: master
only: master
pr:
when: << pipeline.git.branch >>
jobs:
- danger-pr
env-tests:
when: << pipeline.parameters.env-tests >>
jobs:
- install
2 changes: 1 addition & 1 deletion .dangerfile.js
Expand Up @@ -17,7 +17,7 @@ export default async function () {
fail(`Only owner can change system files [${files.join(', ')}], please provide issue instead`, files[0]);
}

if (!src.modified && !tests.modified) {
if (src.modified && !tests.modified) {
warn('Source files were changed without tests');
}

Expand Down

0 comments on commit ae48ac3

Please sign in to comment.