diff --git a/tools/optimize-svg b/tools/optimize-svg new file mode 100755 index 0000000000..1450eddc23 --- /dev/null +++ b/tools/optimize-svg @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ `node_modules/.bin/svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l` -ge 1 ] + then + echo "ERROR: svgo detected unoptimized SVG files in the \`static/images/integrations/logos\` folder." 1>&2 + echo "Please run \`svgo -f static/images/integrations/logos\` and commit the file changes to optimize them." + exit 1 + else + echo "SUCCESS: SVG files in static/images/integrations/logos are all optimized!" +fi diff --git a/tools/test-all b/tools/test-all index ea839a19c8..de273addbf 100755 --- a/tools/test-all +++ b/tools/test-all @@ -39,6 +39,7 @@ run ./tools/test-js-with-node run ./tools/run-mypy run ./tools/test-backend $FORCEARG run ./tools/test-js-with-casper $FORCEARG +run ./tools/optimize-svg # Not running queue worker reload tests since it's low-churn code # run ./tools/test-queue-worker-reload # Not running documentation tests since it takes 20s and only tests documentation diff --git a/tools/travis/backend b/tools/travis/backend index 1ea98d8fa4..92b4038777 100755 --- a/tools/travis/backend +++ b/tools/travis/backend @@ -11,6 +11,7 @@ set -x ./tools/test-migrations # test-run-dev temporarily disabled due to weird Travis CI issues. #./tools/test-run-dev +./tools/optimize-svg ./tools/test-documentation ./tools/test-help-documentation.py ./tools/test-api