Skip to content

Commit

Permalink
find collection and manipulation is the causer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Aug 11, 2024
1 parent 5a0df85 commit 257f467
Showing 1 changed file with 31 additions and 34 deletions.
65 changes: 31 additions & 34 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ jobs:
needs: compute_changed_files
if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' }}
runs-on: ubuntu-20.04
# update later accordingly
outputs:
coverage_report: ${{ steps.run-oppia-coverage-without-caching.outputs.coverage_report }}
strategy:
fail-fast: false
max-parallel: 10
Expand Down Expand Up @@ -275,16 +272,16 @@ jobs:
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: $PB_FILES_LIST"
PB_FILES_LIST2=$(find . -name "coverage_report.pb" -type f)
echo "PB FILES2: $PB_FILES_LIST2"
echo "As separately:"
echo "PB FILES: ${PB_FILES_LIST[@]}"
echo "PB FILES2: ${PB_FILES_LIST2[@]}"
# echo "PB FILES: $PB_FILES_LIST"
# PB_FILES_LIST2=$(find . -name "coverage_report.pb" -type f)
# echo "PB FILES2: $PB_FILES_LIST2"
# echo "As separately:"
# echo "PB FILES: ${PB_FILES_LIST[@]}"
# echo "PB FILES2: ${PB_FILES_LIST2[@]}"
echo "PROTO_FILE_PATHS=${PB_FILES_LIST[@]}" >> $GITHUB_ENV
echo "PROTO_FILE_PATHS: $PROTO_FILE_PATHS"
PFILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
echo "PFILE_PATHS=$PFILE_PATHS" >> $GITHUB_ENV
# echo "PROTO_FILE_PATHS: $PROTO_FILE_PATHS"
# PFILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
# echo "PFILE_PATHS=$PFILE_PATHS" >> $GITHUB_ENV

- name: Set up Bazel
uses: abhinavsingh/setup-bazel@v3
Expand Down Expand Up @@ -312,28 +309,28 @@ jobs:
echo "build --disk_cache=$EXPANDED_BAZEL_CACHE_PATH" >> $HOME/.bazelrc
shell: bash

- name: Generate Markdown Coverage Report
run: |
echo "PB FILES: ${PB_FILES_LIST[@]}"
bazel run //scripts:coverage_reporter -- $(pwd) ${PB_FILES_LIST[@]}
# - name: Generate Markdown Coverage Report
# run: |
# echo "PB FILES: ${PB_FILES_LIST[@]}"
# bazel run //scripts:coverage_reporter -- $(pwd) ${PB_FILES_LIST[@]}

- name: Generate Markdown Coverage Report2
run: |
FILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
echo "File Paths: $FILE_PATHS"
bazel run //scripts:coverage_reporter -- $(pwd) $FILE_PATHS
# - name: Generate Markdown Coverage Report2
# run: |
# FILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
# echo "File Paths: $FILE_PATHS"
# bazel run //scripts:coverage_reporter -- $(pwd) $FILE_PATHS

- name: Generate Markdown Coverage Report3
run: |
FILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
echo "PROTO_FILE_PATHS: $ {{ env.PROTO_FILE_PATHS }}"
# FILE_PATHS=$(printf "%s " "${PB_FILES_LIST[@]}")
# echo "PROTO_FILE_PATHS: $ {{ env.PROTO_FILE_PATHS }}"
bazel run //scripts:coverage_reporter -- $(pwd) ${{ env.PROTO_FILE_PATHS }}

- name: Generate Markdown Coverage Report3
run: |
PFILE_PATHS=${{ env.PFILE_PATHS }}
echo "PFILE_PATHS: $PFILE_PATHS"
bazel run //scripts:coverage_reporter -- $(pwd) $PFILE_PATHS
# - name: Generate Markdown Coverage Report3
# run: |
# PFILE_PATHS=${{ env.PFILE_PATHS }}
# echo "PFILE_PATHS: $PFILE_PATHS"
# bazel run //scripts:coverage_reporter -- $(pwd) $PFILE_PATHS

- name: Upload Generated Markdown Report
uses: actions/upload-artifact@v4
Expand All @@ -354,10 +351,10 @@ jobs:
with:
name: final-coverage-report

- name: List all files
run: |
echo "Listing everything in uploading coverage report"
ls -R
# - name: List all files
# run: |
# echo "Listing everything in uploading coverage report"
# ls -R

- name: Read Coverage Report
run: |
Expand All @@ -378,12 +375,12 @@ jobs:
# Reference: https://github.community/t/127354/7.
check_coverage_results:
name: Check Code Coverage Results
needs: [ compute_changed_files, code_coverage_run ]
needs: [ compute_changed_files, code_coverage_run, upload_coverage_report ]
# 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: ${{ !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' }}
if: ${{ needs.compute_changed_files.outputs.can_skip_files != 'true' && needs.code_coverage_run.result != 'success' && needs.upload_coverage_report.result != 'success' }}
run: exit 1

0 comments on commit 257f467

Please sign in to comment.