diff --git a/.travis.yml b/.travis.yml index 82fdaab4..cc741fe4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,9 +54,10 @@ install: script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm test; + ./scripts/ci/ensure-staged-sass.sh; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - ./scripts/build/docker/run-command.sh -r ${TARGET_ARCH} -s ${PWD} -c "xvfb-run --server-args=$XVFB_ARGS npm test"; + ./scripts/build/docker/run-command.sh -r ${TARGET_ARCH} -s ${PWD} -c "xvfb-run --server-args=$XVFB_ARGS npm test && ./scripts/ci/ensure-staged-sass.sh"; fi notifications: diff --git a/appveyor.yml b/appveyor.yml index 82aff304..5f0dd480 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -43,6 +43,7 @@ build: off test_script: - node --version - npm --version + - bash .\scripts\ci\ensure-staged-sass.sh - cmd: npm test notifications: diff --git a/scripts/ci/ensure-staged-sass.sh b/scripts/ci/ensure-staged-sass.sh new file mode 100755 index 00000000..fed53489 --- /dev/null +++ b/scripts/ci/ensure-staged-sass.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e +set -u + +npm run sass + +# From http://stackoverflow.com/a/9393642/1641422 +if [[ -n $(git status -s) ]]; then + echo "There are unstaged sass changes. Please commit the result of:" 1>&2 + echo "" + echo " npm run sass" 1>&2 + echo "" + exit 1 +fi