Merge pull request #1093 from friday/travis-2

Verify PR instructions with Travis
This commit is contained in:
Sam Potts 2018-07-10 15:24:22 +10:00 committed by GitHub
commit 676b46e4a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,8 @@
language: node_js language: node_js
node_js: node_js: lts/*
- 'lts/*'
script: script:
- npm run lint - bash .travis/prevent-base-master.sh
- npm run build - bash .travis/omit-dist.sh
- npm run lint
- npm run build

5
.travis/omit-dist.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ $TRAVIS_BRANCH == "develop" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "^(demo/)?dist/"); then
echo 'Build output ("dist" and "demo/dist") not permitted in develop' >&2
exit 1
fi

5
.travis/prevent-base-master.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $TRAVIS_BRANCH == "master" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q "^src/"); then
echo 'The base branch for pull requests must be "develop"' >&2
exit 1
fi