Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of coverage files sent to CodeCov due to low API limits #584

Merged
merged 18 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading