Skip to content

Commit

Permalink
update ui format github action
Browse files Browse the repository at this point in the history
* Updated 'ui_ut_run.sh' script to enforce formatting

Signed-off-by: bupd <bupdprasanth@gmail.com>
  • Loading branch information
bupd committed Oct 14, 2024
1 parent 56e3f72 commit 51dc32f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion tests/ci/ui_ut_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -

0 comments on commit 51dc32f

Please sign in to comment.