mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
chore: ensure npm run sass
was ran and the results committed (#1121)
We recently encountered a UI regression caused by forgetting to commit the generated CSS files. The solution is to make the CI servers run `npm run sass` and check if there are unstaged files afterwards. If so, the tests halt. In order to avoid duplication between Travis CI and Appveyor CI, this logic has been encoded into a bash script at `scripts/ci`. See: https://github.com/resin-io/etcher/pull/1120 Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
f4c92676a9
commit
96a9b65ea7
@ -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:
|
||||
|
@ -43,6 +43,7 @@ build: off
|
||||
test_script:
|
||||
- node --version
|
||||
- npm --version
|
||||
- bash .\scripts\ci\ensure-staged-sass.sh
|
||||
- cmd: npm test
|
||||
|
||||
notifications:
|
||||
|
15
scripts/ci/ensure-staged-sass.sh
Executable file
15
scripts/ci/ensure-staged-sass.sh
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user