harbor/tests/ci/ui_ut_run.sh
bupd 51dc32f818
update ui format github action
* Updated 'ui_ut_run.sh' script to enforce formatting

Signed-off-by: bupd <bupdprasanth@gmail.com>
2024-10-14 16:56:54 +05:30

23 lines
472 B
Bash
Executable File

#!/bin/bash
set -x
set -e
cd ./src/portal
npm install -g -q --no-progress @angular/cli
npm install -g -q --no-progress karma
npm install -q --no-progress
# Run format and check for changes
npm run format
# Check if any files were changed by formatting
if [[ -n $(git status --porcelain) ]]; then
echo "Formatting issues found. Please run 'npm run format' and commit the changes."
exit 1
fi
# Lint and run tests
npm run lint
npm run lint:style
npm run test && cd -