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 <[email protected]>
  • Loading branch information
bupd committed Oct 10, 2024
1 parent 27fd1fb commit fd4a4b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ jobs:
cd src/github.com/goharbor/harbor
bash ./tests/showtime.sh ./tests/ci/ui_ut_run.sh
df -h
- name: Check for formatting issues
run: |
cd src/github.com/goharbor/harbor
git diff --exit-code
continue-on-error: true # continue workflow
- 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 fd4a4b9

Please sign in to comment.