소스 검색

[ci] Rename jobs in PR comments workflow for clarity and add UI code coverage steps (#4155)

Harsh Gupta 5 달 전
부모
커밋
a4d5b3d190
1개의 변경된 파일35개의 추가작업 그리고 2개의 파일을 삭제
  1. 35 2
      .github/workflows/pr-comments.yml

+ 35 - 2
.github/workflows/pr-comments.yml

@@ -9,7 +9,7 @@ permissions:
   pull-requests: write
 
 jobs:
-  pytest-codecov-comment:
+  tests-and-coverage:
     runs-on: ubuntu-latest
 
     steps:
@@ -65,7 +65,7 @@ jobs:
           remove-link-from-badge: true
           default-branch: master
   
-  python-ut-files-comment:
+  python-ut-files-check:
     runs-on: ubuntu-latest
     steps:
       - name: Checkout code
@@ -96,3 +96,36 @@ jobs:
         with:
           message: "${{ env.comment_message }}"
           allow-repeats: false
+  
+  ui-tests-and-coverage:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Cache npm with setup node
+        uses: actions/setup-node@v4
+        with:
+          node-version: 20
+          cache: 'npm'
+
+      - name: Install npm dependencies
+        run: npm ci
+      
+      - name: Run js tests with coverage
+        run: |
+          # https://jestjs.io/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
+          npm run test-coverage -- --runInBand
+      
+      - name: Add jest coverage PR comment
+        uses: MishaKav/jest-coverage-comment@v1
+        with:
+          coverage-summary-path: ./reports/jest/coverage-final.json
+          title: UI Code Coverage
+          summary-title: Jest Coverage Report
+          badge-title: Coverage
+          hide-comment: false
+          create-new-comment: false
+          hide-summary: false
+          coverage-title: Coverage Report
+