diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml new file mode 100644 index 000000000..52bb94655 --- /dev/null +++ b/.github/workflows/upstream.yml @@ -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 }} diff --git a/noxfile.py b/noxfile.py index 96a680052..1410c7951 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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": @@ -69,6 +70,10 @@ def _run_tests( *install_args, env=env, ) + session.run( + *extra_commands, + env=env, + ) session.run( "uv", "run", @@ -78,7 +83,7 @@ def _run_tests( "--verbose", *install_args, "pytest", - *run_args, + *pytest_run_args, *session.posargs, "--cov-config=pyproject.toml", env=env, @@ -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."""