mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Merge "build: Enforce check for uncompressed SVG files in CI"
This commit is contained in:
commit
121c0093b9
1
dev-scripts/.htaccess
Normal file
1
dev-scripts/.htaccess
Normal file
|
@ -0,0 +1 @@
|
|||
Deny from all
|
15
dev-scripts/svg_check.sh
Normal file
15
dev-scripts/svg_check.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
found=0
|
||||
for svgfile in `find resources -type f -name "*.svg"`; do
|
||||
outfile="$svgfile.tmp"
|
||||
node_modules/.bin/svgo --config .svgo.config.js -i $svgfile -o $outfile -q
|
||||
if [ $(wc -c $svgfile | awk '{print $1}') -gt $(wc -c $outfile | awk '{print $1}') ]; then
|
||||
echo "File $svgfile is not compressed"
|
||||
found=$((found + 1))
|
||||
fi
|
||||
rm $outfile
|
||||
done
|
||||
if [ $found -gt 0 ]; then
|
||||
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch"
|
||||
exit 1
|
||||
fi
|
|
@ -5,7 +5,7 @@
|
|||
"build-storybook": "./.storybook/storybook-resources.sh && build-storybook --config-dir=.storybook -o docs/ui -s .storybook/static",
|
||||
"start": "webpack -w --mode=development",
|
||||
"build": "webpack --mode=production",
|
||||
"test": "npm -s run check-built-assets && npm run test:lint && npm -s run coverage && npm -s run -s doc && bundlesize && npm run build-storybook",
|
||||
"test": "npm -s run check-built-assets && npm run test:lint && bash ./dev-scripts/svg_check.sh && npm -s run coverage && npm -s run -s doc && bundlesize && npm run build-storybook",
|
||||
"test:unit": "mw-node-qunit 'tests/node-qunit/**/*.test.js' --require \"$PWD/tests/node-qunit/run.js\" | tap-mocha-reporter dot",
|
||||
"test:lint": "npm -s run test:lint:styles && npm -s run test:lint:js && npm -s run test:lint:i18n",
|
||||
"test:lint:js": "npm -s run linter:js",
|
||||
|
|
Loading…
Reference in a new issue