-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f9763d
commit 9ac1741
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This code is a Qiskit project. | ||
# | ||
# (C) Copyright IBM 2024. | ||
# | ||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
|
||
name: Test notebooks that submit jobs | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
execute: | ||
name: Execute notebooks with test-eagle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get relevant changed files | ||
id: all-changed | ||
uses: tj-actions/changed-files@af2816c65436325c50621100d67f6e853cd1b0f1 | ||
with: | ||
files: "{docs/**/*.ipynb,scripts/nb-tester/**/*}" | ||
separator: "\n" | ||
write_output_files: true | ||
|
||
- name: Setup environment | ||
uses: ./.github/actions/set-up-notebook-testing | ||
with: | ||
ibm-quantum-token: ${{ secrets.IBM_QUANTUM_TEST_TOKEN }} | ||
instance: "client-enablement/documentation/qiskit-documenta" | ||
|
||
- name: Execute notebooks | ||
run: python scripts/ci/extended-execute-notebooks.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This code is a Qiskit project. | ||
# | ||
# (C) Copyright IBM 2024. | ||
# | ||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
|
||
""" | ||
Run the notebook tester on changed notebooks (between branch and main) using | ||
test-eagle. | ||
""" | ||
|
||
import os | ||
import subprocess | ||
from pathlib import Path | ||
|
||
all_changed_files = ( | ||
Path(".github/outputs/all_changed_files.txt").read_text().split("\n") | ||
) | ||
|
||
changed_notebooks = [ | ||
path for path in all_changed_files | ||
if path.endswith(".ipynb") | ||
] | ||
config_changed = any(path.startswith("scripts/") for path in all_changed_files) | ||
|
||
args = ["tox", "--", "--test-strategy", "extended"] | ||
if changed_notebooks and not config_changed: | ||
args.extend(changed_notebooks) | ||
|
||
subprocess.run(args, check=True) |