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

[Docs] Test coverage and badge #626

Merged
merged 25 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4066978
Self-generate and commit coverage badge.
RolandMacDoland Dec 3, 2024
0c29d70
Display badge in README.
RolandMacDoland Dec 3, 2024
4219c49
Add coverage-badge dep to self-generate badge.
RolandMacDoland Dec 3, 2024
f7e2818
Generate coverage report as XML.
RolandMacDoland Dec 3, 2024
62d4d12
Merge branch 'main' into rg/test-coverage-and-badge
RolandMacDoland Dec 3, 2024
c0c2345
Install coverage-badge in the workflow.
RolandMacDoland Dec 3, 2024
865d690
Remove coverage-badge from env.
RolandMacDoland Dec 3, 2024
e364f05
Fix syntax to commit and push badge changes.
RolandMacDoland Dec 3, 2024
d4a048a
Attempt to push coverage badge changes directly.
RolandMacDoland Dec 4, 2024
7db9827
Fix typo.
RolandMacDoland Dec 4, 2024
78c528a
Get the coverage branch.
RolandMacDoland Dec 4, 2024
63275a8
Push to the coverage branch.
RolandMacDoland Dec 4, 2024
39ccd48
Fix typo.
RolandMacDoland Dec 4, 2024
c63f198
Track the coverage badge.
RolandMacDoland Dec 4, 2024
c716490
Checkout and push the badge changes.
RolandMacDoland Dec 4, 2024
376428c
Delete coverage file before test generates it.
RolandMacDoland Dec 4, 2024
428825b
Remove producing an badge as svg and attempt to deploy JSON on gh-pages.
RolandMacDoland Dec 5, 2024
ca12978
Update name.
RolandMacDoland Dec 5, 2024
b8f747d
Avoid git conflict in generating the coverage report once.
RolandMacDoland Dec 5, 2024
fdbdd97
Use shields.io to display badge.
RolandMacDoland Dec 5, 2024
8d8663e
Force checkout to overwrite json file.
RolandMacDoland Dec 5, 2024
94ca885
Remove obsolete file.
RolandMacDoland Dec 5, 2024
af176ee
Fix git complaint.
RolandMacDoland Dec 5, 2024
542da91
Attempt not to commit coverage reports.
RolandMacDoland Dec 5, 2024
288661e
Remove useless commented code.
RolandMacDoland Dec 5, 2024
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
21 changes: 13 additions & 8 deletions .github/workflows/test_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,23 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
- name: Install Hatch & Coverage-Badge
run: |
pip install hatch
- name: Run fast tests
pip install coverage-badge
- name: Run fast tests and generate coverage badge
run: |
hatch -v run test -m "not slow"
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: "coverage-data"
path: .coverage.*
if-no-files-found: ignore
coverage-badge -o coverage.svg
- name: Commit and push coverage badge
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git fetch --all
git checkout ${{ github.ref_name }}
git add coverage.svg
git commit -m "Update coverage badge"
git push

publish:
name: Publish to PyPI
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ programs** with tunable qubit interactions and arbitrary register topologies rea
[![Documentation](https://github.com/pasqal-io/qadence/actions/workflows/build_docs.yml/badge.svg)](https://pasqal-io.github.io/qadence/latest)
[![Pypi](https://badge.fury.io/py/qadence.svg)](https://pypi.org/project/qadence/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![Coverage](./coverage.svg)
RolandMacDoland marked this conversation as resolved.
Show resolved Hide resolved

## Feature highlights

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ dependencies = [
features = ["pulser", "visualization", "horqrux", "mlflow"]

[tool.hatch.envs.default.scripts]
test = "pytest -n auto --cov-report lcov --cov-config=pyproject.toml --cov=qadence --cov=tests --ignore=./tests/test_examples.py {args}"
test = "pytest -n auto --cov-report=xml --cov-config=pyproject.toml --cov=qadence --cov=tests --ignore=./tests/test_examples.py {args}"
test-examples = "pytest ./tests/test_examples.py {args}"
no-cov = "cov --no-cov {args}"
test-docs = "mkdocs build --clean --strict"
Expand Down
Loading