Skip to content

Commit

Permalink
Reduce number of coverage files sent to CodeCov due to low API limits (
Browse files Browse the repository at this point in the history
…#584)

* Add GH action run id to coverage file names

* Auto update version

* Add changelog

* Attempt to combine files instead

* Ensure coverage is pip installed

* Ensure coverage is included in command

* Let coverage identify files to merge

* Attempt to combine coverage DB files

* Merge coverage only for Python-LQ/LK host tests

* Ensure main is in coverage path

* Remove combine step from GPU Python coverage tests

* Auto update version

* Trigger CI

* Trigger CI

* Auto update version

* Trigger CI

---------

Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mlxd and github-actions[bot] authored Jan 3, 2024
1 parent 706a599 commit bce3b09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@

### Bug fixes

* Fix CodeCov file contention issue when uploading data from many workloads.
[(#584)](https://github.com/PennyLaneAI/pennylane-lightning/pull/584)

* Ensure the `lightning.gpu` intermediate wheel builds are uploaded to TestPyPI.
[(#575)](https://github.com/PennyLaneAI/pennylane-lightning/pull/575)

Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
env:
TF_VERSION: 2.10.0
TORCH_VERSION: 1.11.0+cpu
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
OMP_NUM_THREADS: "2"

Expand Down Expand Up @@ -167,13 +167,14 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv .coverage .coverage-${{ github.job }}-${{ matrix.pl_backend }}
- name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-python
path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
path: |
./main/.coverage-${{ github.job }}-${{ matrix.pl_backend }}
if-no-files-found: error

cpptestswithOpenBLAS:
Expand Down Expand Up @@ -317,13 +318,13 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv .coverage .coverage-${{ github.job }}-${{ matrix.pl_backend }}
- name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-python
path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
path: ./main/.coverage-${{ github.job }}-${{ matrix.pl_backend }}
if-no-files-found: error

build_and_cache_Kokkos:
Expand Down Expand Up @@ -514,7 +515,7 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv .coverage .coverage-${{ github.job }}-${{ matrix.pl_backend }}
- name: Install all backend devices
if: ${{ matrix.pl_backend == 'all' }}
Expand All @@ -536,13 +537,13 @@ jobs:
PL_DEVICE=lightning.kokkos python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device lightning.kokkos --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device lightning.kokkos --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv .coverage .coverage-${{ github.job }}-${{ matrix.pl_backend }}
- name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ubuntu-codecov-results-python
path: ./main/coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
path: ./main/.coverage-${{ github.job }}-${{ matrix.pl_backend }}
if-no-files-found: error

upload-to-codecov-linux-python:
Expand All @@ -552,12 +553,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-tags: true
path: main

- name: Download coverage reports
uses: actions/download-artifact@v3
with:
name: ubuntu-codecov-results-python

- name: Combine coverage files
run: |
python -m pip install coverage
python -m coverage combine .coverage-python*
python -m coverage xml -o coverage-${{ github.job }}.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.34.0-dev24"
__version__ = "0.34.0-dev25"

0 comments on commit bce3b09

Please sign in to comment.