From f46fa688bc8453a3c9efb0b7fcfb0e20797c0114 Mon Sep 17 00:00:00 2001 From: RD Rama Devi <122200035+Rd4dev@users.noreply.github.com> Date: Sun, 18 Aug 2024 20:10:42 +0530 Subject: [PATCH] Removed evaluate, status check job --- .github/workflows/code_coverage.yml | 78 +---------------------------- 1 file changed, 1 insertion(+), 77 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 13f2fef29..cc8b48457 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -247,86 +247,10 @@ jobs: CHANGED_FILES: ${{ env.CHANGED_FILES }} run: | echo "CHANGED FILES: $CHANGED_FILES" - bazel run //scripts:run_coverage -- $(pwd) $CHANGED_FILES --format=PROTO --processTimeout=15 - - - name: Filter Coverage Reports from Code Coverage Run - run: | - # Find all coverage_report.pb files in the current directory and subdirectories - PB_FILES_LIST=($(find . -name "coverage_report.pb" -type f -print0 | xargs -0 -n 1 echo)) - echo "PB File list from code coverage run: ${PB_FILES_LIST[@]}" - echo "${PB_FILES_LIST[@]}" > cc_pb_files.txt - echo "$(cat ./cc_pb_files.txt)" + bazel run //scripts:run_coverage -- $(pwd) $CHANGED_FILES --format=PROTO --processTimeout=15 - name: Upload Coverage Report Artifact uses: actions/upload-artifact@v4 with: name: coverage-report-${{ env.SHARD_NAME }} # Saving with unique names to avoid conflict path: coverage_reports - - evaluate-code-coverage-reports: - name: Evaluate Code Coverage Reports - runs-on: ubuntu-20.04 - needs: code_coverage_run - if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' }} - env: - CACHE_DIRECTORY: ~/.bazel_cache - steps: - - uses: actions/checkout@v2 - - - name: Download Coverage Report Artifacts - uses: actions/download-artifact@v4 - with: - path: coverage-report-artifact - pattern: coverage-report-* - merge-multiple: true - - - name: Filter Coverage Reports - run: | - # Find all coverage_report.pb files in the current directory and subdirectories - PB_FILES_LIST=($(find . -name "coverage_report.pb" -type f -print0 | xargs -0 -n 1 echo)) - echo "${PB_FILES_LIST[@]}" > pb_files.txt - - - name: Set up Bazel - uses: abhinavsingh/setup-bazel@v3 - with: - version: 6.5.0 - - - uses: actions/cache@v2 - id: scripts_cache - with: - path: ${{ env.CACHE_DIRECTORY }} - key: ${{ runner.os }}-${{ env.CACHE_DIRECTORY }}-bazel-scripts-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ env.CACHE_DIRECTORY }}-bazel-scripts- - ${{ runner.os }}-${{ env.CACHE_DIRECTORY }}-bazel- - - - name: Set up build environment - uses: ./.github/actions/set-up-android-bazel-build-environment - - - name: Generate Markdown Coverage Report - run: | - bazel run //scripts:coverage_reporter -- $(pwd) pb_files.txt - - - name: Upload Generated Markdown Report - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} # IMPORTANT: Upload reports regardless of success or failure status - with: - name: final-coverage-report - path: coverage_reports/CoverageReport.md - - # Reference: https://github.community/t/127354/7. - check_coverage_results: - name: Check Code Coverage Results - needs: [ compute_changed_files, code_coverage_run, evaluate-code-coverage-reports ] - # The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations, - # serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows. - if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' && !cancelled()}} - runs-on: ubuntu-20.04 - steps: - - name: Check coverages passed - if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' && needs.code_coverage_run.result != 'success' }} - run: exit 1 - - - name: Check that coverage status is passed - if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' && needs.evaluate-code-coverage-reports.result != 'success' }} - run: exit 1