Skip to content

Commit

Permalink
Fix tests code coverage processing
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanZRasa committed Jan 8, 2025
1 parent ee37bcc commit 21353de
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ jobs:
with:
name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage
path: |
${{ github.workspace }}/${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage
${{ github.workspace }}/${{ matrix.test }}-coverage
test-flaky:
name: Run Flaky Tests
Expand Down Expand Up @@ -553,11 +553,11 @@ jobs:

- name: Store coverage reports
if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-24.04'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage
path: |
${{ github.workspace }}/${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage
${{ github.workspace }}/test-flaky-coverage
upload_coverage_reports:
name: Upload coverage reports to codeclimate
Expand All @@ -566,6 +566,7 @@ jobs:
# Always upload results even if tests failed
needs:
- test
- test-flaky
- changes

steps:
Expand All @@ -580,25 +581,23 @@ jobs:

- name: Get backend coverage reports
if: needs.changes.outputs.backend == 'true'
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8
uses: actions/download-artifact@v4 #v4.1.8
with:
path: ${{ github.workspace }}/tests_coverage
pattern: "*-coverage"
merge-multiple: true

- name: Merge all reports
- name: List all coverages
if: needs.changes.outputs.backend == 'true'
run: |
subs=`ls ${{ github.workspace }}/tests_coverage`
download_dir="${{ github.workspace }}/tests_coverage"
final_dir="${{ github.workspace }}/tests_coverage/final"
# Downloaded artifacts go into folders, gotta extract them all into one folder for upload
mkdir "${final_dir}/"
for i in $subs; do
mv "${download_dir}/$i"/* "${final_dir}/"
done
ls -l ${{ github.workspace }}
ls -l ${{ github.workspace }}/tests_coverage
- name: Merge all reports
if: needs.changes.outputs.backend == 'true'
run: |
pip install coverage
coverage combine "${final_dir}/"*
coverage combine "${{ github.workspace }}/tests_coverage/*"
coverage xml
- name: Upload reports to codeclimate
Expand Down

0 comments on commit 21353de

Please sign in to comment.