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

ci: Submit test coverage to codecov #151

Merged
merged 4 commits into from
Mar 4, 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
40 changes: 39 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Pull Request

on: pull_request
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
types: [checks_requested]
workflow_dispatch: {}

env:
SCCACHE_GHA_ENABLED: "true"
Expand Down Expand Up @@ -56,3 +65,32 @@ jobs:

- name: Rerun `py(...)` expression tests with tket2 installed
run: poetry run pytest tests/integration/test_py.py tests/error/test_py_errors.py

coverage:
if: github.event_name != 'merge_group'
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
cache: "poetry"

- name: Install Guppy with validation and pytket
run: poetry install --with validation --with pytket

- name: Run python tests with coverage instrumentation
run: poetry run pytest --cov=./ --cov-report=xml

- name: Upload python coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: coverage.xml
name: python
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Guppy

[![codecov][]](https://codecov.io/gh/CQCL/guppylang)

[codecov]: https://img.shields.io/codecov/c/gh/CQCL/guppylang?logo=codecov

Guppy is a quantum programming language that is fully embedded into Python.
It allows you to write high-level hybrid quantum programs with classical control flow and mid-circuit measurements using Pythonic syntax:

Expand Down
87 changes: 86 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ typing-extensions = "^4.9.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.4"
pytest-cov = "^4.1.0"
mypy = "^1.8.0"
pre-commit = "^3.6.0"
ruff = ">=0.3"
Expand Down
Loading