update ui format github action

* Updated 'ui_ut_run.sh' script to enforce formatting

Signed-off-by: bupd <bupdprasanth@gmail.com>
This commit is contained in:
bupd 2024-10-10 08:21:09 +05:30
parent 56e3f72c4b
commit 51dc32f818
No known key found for this signature in database
GPG Key ID: B35EA0BCF8128810
2 changed files with 16 additions and 1 deletions

View File

@ -330,6 +330,11 @@ jobs:
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/ci/ui_ut_run.sh
df -h
- name: Fail if format changes are detected
if: ${{ failure() }}
run: |
echo "Code formatting issues detected. Please run 'npm run format' locally and commit the changes."
exit 1
- name: Codecov For UI
uses: codecov/codecov-action@v4
with:

View File

@ -6,7 +6,17 @@ cd ./src/portal
npm install -g -q --no-progress @angular/cli
npm install -g -q --no-progress karma
npm install -q --no-progress
# check code lint first then run ut test
# 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 -