Skip to content

Commit

Permalink
✨ add continuous testing workflow for running against the latest Qisk…
Browse files Browse the repository at this point in the history
…it main branch

Signed-off-by: burgholzer <burgholzer@me.com>
  • Loading branch information
burgholzer committed Mar 11, 2025
1 parent b7c3cfc commit a118f91
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Qiskit Upstream Tests
on:
schedule:
# Run every Monday at 00:00 UTC
- cron: "0 0 * * 1"
pull_request:
paths:
- ".github/workflows/upstream.yml"
workflow_dispatch: # Allow manual triggering

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
qiskit-upstream-tests:
name: 🐍⚛️
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2025]
uses: cda-tum/mqt-workflows/.github/workflows/reusable-qiskit-upstream.yml@v1.7
with:
runs-on: ${{ matrix.os }}
19 changes: 16 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def _run_tests(
session: nox.Session,
*,
install_args: Sequence[str] = (),
run_args: Sequence[str] = (),
extra_commands: Sequence[str] = (),
pytest_run_args: Sequence[str] = (),
) -> None:
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
if os.environ.get("CI", None) and sys.platform == "win32":
Expand All @@ -69,6 +70,10 @@ def _run_tests(
*install_args,
env=env,
)
session.run(
*extra_commands,
env=env,
)
session.run(
"uv",
"run",
Expand All @@ -78,7 +83,7 @@ def _run_tests(
"--verbose",
*install_args,
"pytest",
*run_args,
*pytest_run_args,
*session.posargs,
"--cov-config=pyproject.toml",
env=env,
Expand All @@ -97,13 +102,21 @@ def minimums(session: nox.Session) -> None:
_run_tests(
session,
install_args=["--resolution=lowest-direct"],
run_args=["-Wdefault"],
pytest_run_args=["-Wdefault"],
)
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
session.run("uv", "tree", "--frozen", env=env)
session.run("uv", "lock", "--refresh", env=env)


@nox.session(reuse_venv=True, venv_backend="uv", python=PYTHON_ALL_VERSIONS)
def qiskit(session: nox.Session) -> None:
"""Tests against the latest version of Qiskit."""
_run_tests(session, extra_commands=["uv", "pip", "install", "qiskit @ git+https://github.com/Qiskit/qiskit.git"])
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
session.run("uv", "pip", "show", "qiskit", env=env)


@nox.session(reuse_venv=True)
def docs(session: nox.Session) -> None:
"""Build the docs. Use "--non-interactive" to avoid serving. Pass "-b linkcheck" to check links."""
Expand Down

0 comments on commit a118f91

Please sign in to comment.